Present-day galaxies are surrounded by cool and enriched halo gas extending for hundreds of kiloparsecs. This halo gas is thought to be the dominant reservoir of material available to fuel future star formation, but direct constraints on its mass and physical properties have been difficult to obtain. We report the detection of a fast radio burst (FRB 181112), localized with arcsecond precision, that passes through the halo of a foreground galaxy. Analysis of the burst shows that the halo gas has low net magnetization and turbulence. Our results imply predominantly diffuse gas in massive galactic halos, even those hosting active supermassive black holes, contrary to some previous results.