Nitrosamines (NAs), which are catalogued as carcinogenic compounds, may be present in meat products due to the conversion of nitrites and as result of migration from elastic rubber nettings used. A method based on ultrasonic assisted extraction coupled with dispersive liquid–liquid microextraction as sample treatment and gas chromatography-mass spectrometry as separation and detection technique was proposed for the determination of twelve NAs in cooked ham samples. The method was validated by evaluating linearity (0.5–1000 ng g−1), matrix effect, sensitivity (detection limits were between 0.15 and 1.4 ng g−1) and precision, which was below 12%. Five NAs were found in the samples with levels ranging from not quantifiable to 40 ng g−1. The effect of the elastic rubber nettings on the nitrosamine content of meat was evaluated by comparing the levels found in products made with several plastics or thread in the presence of additives.