I was cleaning out my fridge and came across a milk carton (2%) that was bulging. I opened the cap and it released gas, and a horrible smell. I poured it down the drain and ventilated my apartment. How likely is it that I could have contracted a pathogen just by breathing?
Extremely unlikely. This is simply unpleasant but not dangerous. The gas is mostly carbon dioxide released by bacteria in the milk fermenting the lactose sugar. Other products of the fermentation cause the foul smell.
Drinking the milk is another matter, as there will usually be bacterial overgrowth and a build up of lactic acid which will cause gastrointestinal symptoms such as vomiting and diarrhoea. In rare cases a person could become more seriously unwell.
Nonpasteurized Dairy Products, Disease Outbreaks, and State Laws—United States, 1993–2006 by authors affiliated to the US Centre for Disease Control.