The corrosive part is actually the primer residue. The reason it's corrosive is that after the primer goes off, potassium chloride is left in the barrel. What's potassium chloride? It's a type of salt! What does salt do to iron (and thus steel) in the presence of any moisture? It catalyzes an oxidation/reduction reaction...better known as corrosing, or rusting.
Fortunately, salts are easy to deal with. Like its brother sodium chloride (table salt), potassium chloride dissolves in water very easily. So, just flush out your bore with some water, along with anywhere else the primer residue would normally go (e. g. gas tubes in certain semi-autos, and the piston face). Takes maybe a minute or two. Then, just clean your firearm as normal.
For bolt guns like Mosins and Mausers, it's even simpler. The primer dust goes into the chamber and down the barrel; no gas tube to worry about. Just the bore and the chamber.