Volatile components are abundant in carbonaceous asteroids and can be important tracers for the evolution of asteroid surfaces interacting with the space environment, but their behavior on airless surfaces is poorly understood. Samples from the C-type carbonaceous asteroid Ryugu show dehydration of phyllosilicate, indicating ongoing surface modifications on the aqueously-altered asteroid. Here we report the analysis of Ryugu samples showing selective liberation of carbon, oxygen, and sulfur from iron-rich oxide, sulfide, and carbonate, which are major products of aqueous alteration. These mineral surfaces are decomposed to metallic iron, iron nitride, and magnesium-iron oxide. The modifications are most likely caused by solar wind implantation and micrometeorite impacts and are distinct indicators of surface space exposure over 103 years. Nitridation of metallic iron may require micrometeorites rich in solid nitrogen compounds, which implies that the amount of nitrogen available for planetary formation in the inner solar system is larger than previously recognized.