This study investigated the structural heterogeneity, mechanical property, electrochemical behavior, and passive film characteristics of Fe–Cr–Mo–W–C–B–Y metallic glasses (MGs), which were modified through annealing at different temperatures. Results showed that annealing MGs below the glass transition temperature enhanced corrosion resistance in HCl solution owing to a highly protective passive film formed, originating from the decreased free volume and the shrinkage of the first coordination shell, which was found by pair distribution function analysis. In contrast, the enlarged first coordination shell and nanoscale crystal-like clusters were identified for MGs annealed in the supercooled liquid region, which led to a destabilized passive film and thereby deteriorated corrosion resistance. This finding reveals the crucial role of structural heterogeneity in tuning the corrosion performance of MGs.