The cocoon of pussmoths is waterproof because it's made from a mixture of wood litter, spinneret thread, and formic acid.
“The puss caterpillar scrapes hoary wood around the cocoon to camouflage it, and it does not make the mistake of digging pale wood from deeper layers. The wood litter is mixed with the spinneret thread which is hardened by a formic acid solution from a neck . The whole is entirely water-proof.” (Pallasmaa 1995:95)