Eggshells are porous. The salmonella can get through to the egg itself.
Yes the egg shell is porous to gases — the growing chicken embryo has to exchange O2 and CO2 through the shell, but bacteria do not penetrate the shell nor the membrane just under the shell. The shell is a semipermeable membrane, which means that air and moisture can pass through its pores. The shell also has a thin outermost coating called the bloom or cuticle that helps keep out bacteria and particulates.
Gotta disagree with you, ‘cuz your science is bad.
Think about it - since EVERY chicken egg exits EVERY hen via what is essentially the chicken’s large intestine, (cloaca) then EVERY egg is surface contaminated with gut bacteria. *IF* the shell was porous to bacteria, then EVERY egg would ‘spoil’ prior to hatching. Nature (i.e., God) did not design-in an inherent weakness like that.
Just sayin’