Generally extreme pH conditions are considered to be corrosive for metals.
If environment is acidic the chance of corrosion increases
if environment is basic the chance of corrosion increases
from the given compounds:
Vinegar: it is acetic acid (diluted though) and hence it is acidic in nature will have pH less than 7
Soda: it is NaOH and hence it is basic in nature will have pH more than 7 .
So these two substances will be corrosive in nature.