PackageTrack
Sign in Get early access

ammonia

HTML Sanitization

4.1.4 14M downloads/mo #2554 most downloaded on crates.io rust-ammonia/ammonia

What this package is like to depend on

Last release 1 months ago

22 Jul 2026

Release timing varies

gaps range from 3 weeks to 1.3 years

Nearly every release is documented

notes for 19 of 19 stable releases

26 versions withdrawn

withdrawn after publishing

11 years old

45 releases · first in 2015

9 releases in the last 12 months

see the full history below

Release timeline

45 releases · Sep 2015 to Jul 2026
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 45
  1. 4.1.4 22 Jul 2026
    Release notes
    • fix: SVG animation and set can cause XSS, because attributeName is not checked (reported by Younghun Ko, koyokr)
    Open source →
    Release notes
    • fix: SVG animation and set can cause XSS, because attributeName is not checked (reported by Younghun Ko, koyokr)
    Open source →
  2. 4.1.3 30 Jun 2026
    Release notes
    • fix: unexpected namespace switches after cleanup on MathML annotation-xml can cause mXSS

    Special thanks to Ivan Ivančić (ivan0912, YesWeHack) for finding this vulnerability!

    Open source →
    Release notes
    • fix: unexpected namespace switches after cleanup on MathML annotation-xml can cause mXSS (reported by Ivan Ivančić)

    • chore: upgrade to html5ever 0.37.1

    • chore: always strip the contents of selectedcontent elements, since the parser will always replace it with the actual contents anyway

    Open source →
  3. 4.1.2 22 Sep 2025
    Release notes
    • fix: unexpected namespace switches after cleanup can cause mXSS (reported by [email protected])
    Open source →
    Release notes
    • fix: unexpected namespace switches after cleanup can cause mXSS (reported by [email protected])
    Open source →
  4. 4.1.1 08 Jul 2025
    Release notes
    Open source →
    Release notes
    Open source →
  5. 4.1.0 21 Apr 2025
    Release notes
    • chore: bump MSRV to 1.80.0
    • chore: switch to std's LazyLock instead of once_cell's Lazy
    • feature: improve panic message when clean_content_tags conflicts with other options
    • feature: add support for sanitizing the style attribute
    Open source →
  6. 4.0.3 22 Jul 2026
    Release notes
    • fix: SVG animation and set can cause XSS, because attributeName is not checked (reported by Younghun Ko, koyokr)
    Open source →
  7. 4.0.2 30 Jun 2026
    Release notes
    • fix: unexpected namespace switches after cleanup on MathML annotation-xml can cause mXSS

    Special thanks to Ivan Ivančić (ivan0912, YesWeHack) for finding this vulnerability!

    Open source →
  8. 4.0.1 22 Sep 2025
    Release notes
    • fix: unexpected namespace switches after cleanup can cause mXSS (reported by [email protected], backport 4.1.2)
    Open source →
    Release notes
    • fix: unexpected namespace switches after cleanup can cause mXSS (backport 4.1.2)
    Open source →
  9. 4.0.0 25 Mar 2024
    Release notes
    • Update html5ever to 0.27
    • feature: change lifetimes on UrlRelative (breaking change)
    • chore: use the Display trait (and ToString) instead of an inherent to_string method (breaking change)
    • Security fixes are not backported to the 2.0 branch any more. Only the v3 and v4 branches are supported.
    Open source →
  10. 3.3.3 22 Jul 2026
    Release notes
    • fix: SVG animation and set can cause XSS, because attributeName is not checked (reported by Younghun Ko, koyokr)
    Open source →
  11. 3.3.2 30 Jun 2026
    Release notes
    • fix: unexpected namespace switches after cleanup on MathML annotation-xml can cause mXSS

    Special thanks to Ivan Ivančić (ivan0912, YesWeHack) for finding this vulnerability!

    Open source →
  12. 3.3.1 22 Sep 2025
    Release notes
    • fix: unexpected namespace switches after cleanup can cause mXSS (reported by [email protected], backport 4.1.2)
    Open source →
    Release notes
    • fix: unexpected namespace switches after cleanup can cause mXSS (backport 4.1.2, reported by [email protected])
    Open source →
  13. 3.3.0 29 Nov 2022
    Release notes
    • chore: bump MSRV to 1.60.0
    • docs: fix incorrect XSS example
    • feature: add UrlRelative::RewriteWithRoot
    Open source →
  14. 3.2.1 15 Aug 2022
    Release notes
    Open source →
  15. 3.2.0 07 Apr 2022
    Release notes
    • chore: bump MSRV to 1.49.0
    • chore: update to html5ever 0.26
    • chore: switch from lazy_static to once_cell
    • feature: add Builder::empty() constructor
    Open source →
  16. 3.1.4 16 Feb 2022
    Release notes
    • chore: use #[non_exhaustive] instead of hidden variant for UrlRelative policy
    • chore: remove unnecessary dependency on third-party matches! macro
    Open source →
  17. 3.1.3 19 Jan 2022
    Release notes
    • fix: incorrect FF/CR handling in clean_text
    • fix: split class name attribute by all ASCII whitespace, not just SP 0x20
    • docs: fix incorrect English in is_html documentation
    Open source →
  18. 3.1.2 08 Jul 2021 withdrawn
    Release notes
    • fix: unexpected namespace switches can allow XSS via svg/mathml parsing
    Open source →
  19. 3.1.1 05 Mar 2021 withdrawn
    Release notes
    • fix: Crash on invalid URLs in some configurations (issue #136)
    Open source →
  20. 3.1.0 10 Mar 2020 withdrawn
    Release notes
    • feature: Whitelist generic attribute prefix
    • chore: Update html5ever to 0.25
    • feature: support adding attribute values to elements
    Open source →
  21. 3.0.0 25 Jul 2019 withdrawn
    Release notes
    Open source →
  22. 2.1.4 19 Jan 2022
    Release notes
    • fix: split class name attribute by all ASCII whitespace, not just SP 0x20 (backported from 3.1.3)
    Open source →
  23. 2.1.3 08 Jul 2021
    Release notes
    • fix: unexpected namespace switches can allow XSS via svg/mathml parsing (backported from 3.1.2)
    Open source →
  24. 2.1.2 28 Jun 2019 withdrawn
    Release notes
    • Fix a memory leak caused by certain node types.
    Open source →
  25. 2.1.1 08 May 2019 withdrawn
    Release notes
    • Update dependencies
    Open source →
  26. 2.1.0 27 Apr 2019 withdrawn
    Release notes
    • Bump minimum supported Rust version to 1.30.
    • Fix a potential DoS attack from pathologically nested input.
    Open source →
  27. 2.0.0 28 Dec 2018 withdrawn
    Release notes
    • Add "script" and "style" to the default set of clean content tags
    • Make all iterator-accepting APIs use IntoIterator and Borrow, so that you can pass slices directly to them.
    Open source →
  28. 1.2.0 18 Jul 2018 withdrawn
    Release notes
    Open source →
  29. 1.1.0 04 Mar 2018 withdrawn
    Release notes
    Open source →
  30. 1.0.1 24 Dec 2017 withdrawn
    Release notes
    • Update dependencies
    Open source →
  31. 1.0.0 12 Nov 2017 withdrawn
    Release notes
    • Breaking change: The Ammonia struct is now called Builder and uses that pattern for better forward compatibility
    • Breaking change: The Builder::clean() method now returns a Document struct instead of a String. You can use the Document::to_string method to obtain a String.
    • Breaking change: keep_cleaned_elements has changed from being an off-by-default option to the only supported behavior
    • Breaking change: Using a tag with allowed_classes means that the class attribute is banned from tag_attributes (it used to be required)
    • Breaking change: The default set of allowed elements and attributes was expanded
    • Added support for reading the input from a stream
    • Added UrlRelative::Custom, allowing you to write your own relative URL resolver
    • Changed UrlRelative::RewriteWithBase take a custom URL. This made the url crate a public dependency.
    • Added id_prefix, which can be used to avoid element id collisions with the rest of the page
    • Added property getters to Builder, to see what everything is currently set to
    • Added property modifiers, to change the existing whitelist (instead of completely replacing it)
    Open source →
  32. 1.0.0-rc3 26 Oct 2017 pre-release withdrawn

    Nothing published for this version

  33. 1.0.0-rc2 24 Oct 2017 pre-release withdrawn

    Nothing published for this version

  34. 1.0.0-rc1 26 Sep 2017 pre-release withdrawn

    Nothing published for this version

  35. 0.7.0 29 Aug 2017 withdrawn
    Release notes
    • Add allowed_classes, allowing the user to set only specific items that can go in the class attribute
    Open source →
  36. 0.6.1 29 Aug 2017 withdrawn
    Release notes
    • Fix a bug in the traversal code
    Open source →
  37. 0.6.0 21 Aug 2017 withdrawn
    Release notes
    • Resolve relative URLs with a given base (off by default, you need to specify that base URL)
    • Add rel="noreferrer noopener" to links, as a security measure
    • Avoid closing void tags, such as turning <br> into <br></br>
    • Bump the html5ever version
    • Switch to using docs.rs to host docs
    Open source →
  38. 0.5.0 16 Jun 2017 withdrawn
    Release notes
    • Bump html5ever to 0.18 (this updates serde from 0.9 to 1.0)
    Open source →
  39. 0.4.0 09 Jun 2017 withdrawn
    Release notes
    • Upgrade to html5ever 0.17
    Open source →
  40. 0.3.0 23 Mar 2017 withdrawn
    Release notes
    • Add an option to keep elements that had attributes removed
    Open source →
  41. 0.2.0 14 Mar 2017 withdrawn
    Release notes
    • Removed the strip option. Not a security problem, but it was wrong and looked stupid. I'm not going to reintroduce this until html5ever allows me to preserve the original text enough to have non-stripped tags come out exactly like they go in.
    • Treat the data attribute of object as a URL. In non-default configurations, this could have been a leak.
    • Update to the newest html5ever.
    Open source →
  42. 0.1.3 16 Nov 2016 withdrawn

    Nothing published for this version

  43. 0.1.2 27 Jun 2016 withdrawn

    Nothing published for this version

  44. 0.1.1 29 Dec 2015 withdrawn

    Nothing published for this version

  45. 0.1.0 04 Sep 2015 withdrawn

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive