Detection and attribution studies routinely use linear regression methods referred to as optimal fingerprinting. Within the latter methodological paradigm, it is usually recognized that multiple sources of uncertainty affect both the observations and the simulated climate responses used as regressors. These include for instance internal variability, climate model error, or observational error. When all errors share the same covariance, the statistical inference is usually performed with the so-called total least squares procedure, but to date no inference procedure is readily available in the climate literature to treat the general case where this assumption does not hold. Here we address this deficiency. After a brief outlook on the error-in-variable models literature, we describe an inference procedure based on likelihood maximization, inspired by a recent article dealing with a similar situation in geodesy. We evaluate the performance of our approach via an idealized test bed. We find the procedure to outperform existing procedures when the latter wrongly neglect some sources of uncertainty.