  Observations of high-redshift Type Ia supernovae (SNe~Ia) are used to study
the cosmic transparency at optical wavelengths. Assuming a flat $\Lambda$CDM
cosmological model based on BAO and CMB results, redshift dependent deviations
of SN~Ia distances are used to constrain mechanisms that would dim light. The
analysis is based on the most recent Pantheon SN compilation, for which there
is a $0.03\pm0.01 {\textrm \,(\rm stat)}$ mag discrepancy in the distant
supernova distance moduli relative to the $\Lambda$CDM model anchored by
supernovae at $z<0.05$. While there are known systematic uncertainties that
combined could explain the observed offset, here we entertain the possibility
that the discrepancy may instead be explained by scattering of supernova light
in the intergalactic medium (IGM). We focus on two effects: Compton scattering
by free electrons and extinction by dust in the IGM. We find that if the
discrepancy is due entirely to dimming by dust, the measurements can be modeled
with a cosmic dust density $\Omega_{\rm IGM}^{\rm dust} = 8 \cdot 10^{-5}
(1+z)^{-1}$, corresponding to an average attenuation of $2\cdot 10^{-5}$ mag
Mpc$^{-1}$ in V-band. Forthcoming SN~Ia studies may provide a definitive
measurement of the IGM dust properties, while still providing an unbiased
estimate of cosmological parameters by introducing additional parameters in the
global fits to the observations.
