Beautification

Is ambergris pure?

Q: I would like to know if ambergris is pure. I've heard that it is either the vomit or faeces of a sperm whale. In light of the Shafi and Hanafi madhab, would a perfume containing ambergris be ritually impure?