  The origin of magnetic fields in the Universe is an open problem. Seed
magnetic fields possibly produced in early times may have survived up to the
present day close to their original form, providing an untapped window to the
primeval Universe. The recent observations of high-energy neutrinos from the
blazar TXS 0506+056 in association with an electromagnetic counterpart in a
broad range of wavelengths can be used to probe intrinsic properties of this
object and the traversed medium. Here we show that intergalactic magnetic
fields (IGMFs) can affect the intrinsic spectral properties of this object
reconstructed from observations. In particular, we point out that the
reconstructed maximum gamma-ray energy of TXS 0506+056 can be significantly
higher if IGMFs are strong. Finally, we use this flare to constrain both the
magnetic-field strength and the coherence length of IGMFs.
