Insects on corpses could be a useful tool for the detection of exogenous substances such as drugs of abuse. The identification of exogenous substances in carrion insects is critical for proper estimation of the postmortem interval. It also provides information about the deceased person that may prove useful for forensic purposes. High-performance liquid chromatography coupled with Fourier transform mass spectrometry is a highly sensitive analytical technique that can identify substances even at very low concentrations, such as in the case of searching for exogenous substances in larvae. In this paper, a method is proposed for the identification of morphine, codeine, methadone, 6-monoacetylmorphine (6-MAM) and 2-ethylidene-1,5-dimethyl-3,3-diphenylpyrrolidine (EDDP) in the larvae ofLucilia sericata, a common carrion fly widely distributed in temperate areas of the world. The larvae, which were reared on a pig meat substrate, were killed once they reached their third stage by immersion in hot water at 80 °C and aliquoted into 400 mg samples. The samples were fortified with 5 ng of morphine, methadone and codeine. After solid-phase extraction, the samples were processed with a liquid chromatograph coupled to a Fourier transform mass spectrometer. This qualitative method has been validated and tested on larvae from a real case. The results lead to the correct identification of morphine, codeine, methadone and their metabolites. This method could prove useful in cases where toxicological analysis must be conducted on highly decomposed human remains, where biological matrices are very limited. Furthermore, it could help the forensic pathologist to better estimate the time of death, as the growth cycle of carrion insects can undergo changes if exogenous substances are taken.