Vinegar is a common home remedy for rust on cast iron. Its mild acid dissolves rust, but the same acid can attack the iron itself if the pan sits in it too long. The short answer is yes, vinegar can remove rust, but only with close attention to timing.
Mix a diluted solution
Many guides use about equal parts white vinegar and water, enough to cover the rusty area. Full-strength vinegar is harsher and more likely to etch the surface.
Keep the soak short and set a timer
Guides differ on how long is safe. Many suggest keeping a soak to around 30 to 60 minutes, and some allow longer with frequent checks. Leaving a pan in vinegar for hours or overnight is the main risk, because the acid keeps working on the bare iron after the rust is gone. Set a timer, and check the pan every 10 to 15 minutes.
Scrub, rinse and neutralize
When the rust has loosened, take the pan out and scrub off the rest with steel wool or a stiff brush. Rinse thoroughly with clean water. Some people then wash the pan with a little baking soda in water to neutralize any leftover acid before drying. Whether you do this or not, dry the pan at once.
Dry and re-season
Put the pan on a warm burner until it is fully dry. Then oil it and build a new layer of seasoning. Vinegar strips seasoning as it removes rust, so expect to re-season. The steps are in how to season a cast iron pan.
When vinegar is not a good fit
If the pan has deep pitting, or if the rust is very thick, a vinegar soak may not be the right tool. Read how to remove heavy rust from cast iron for other options. Also keep in mind that a longer soak is not a faster one. If you are wondering whether a longer soak is safe for a pan you have already cleaned, is it ok to soak cast iron pan covers that question in more detail.