There are certainly ingredients in shaving foam, but I don't think there's anything too dangerous for latex. Indeed if you ask some people it seems everything is bad for latex! Some of mine has been exposed to most things and survived. Just give it a good rinse and let it d dry naturally - it does absorb liquids so needs time to air fully.