# CVE-2026-102342: Ammonia cross-site scripting in SVG animate and set tags

Source: https://junglewise.ai/threats/cve-2026-102342-ammonia-improper-neutralization-of-input-during-web-page  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-13. Updated: 2026-09-29  
License: CC BY 4.0 with a link back

CVE-2026-102342 · Severity: medium · CVSS 5.4 · Published 2026-10-13

Ammonia is a Rust library that sanitizes HTML to prevent attacks. It fails to properly neutralize SVG animate and set tags, allowing attackers to inject JavaScript code that runs when a user clicks a crafted link. Applications using Ammonia to clean user-supplied HTML are vulnerable to stored cross-site scripting attacks that can steal session tokens, redirect users, or perform actions on their behalf.

Technologies: [ammonia (crates.io)](https://junglewise.ai/threats/technologies/ammonia). Vendors: [crates.io](https://junglewise.ai/threats/vendors/crates-io).

## Quick answers

**Is CVE-2026-102342 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-102342 being exploited in the wild.

**How severe is CVE-2026-102342?** Medium severity, with a CVSS score of 5.4, published 13 October 2026.

**Which products and versions are affected?** Ammonia Project Ammonia < 3.3.2, >= 4.0.0 and <= 4.0.2, >= 4.1.2 and <= 4.1.3; ammonia (crates.io) SEMVER:introduced=0,fixed=3.3.3.

**Is there a fix for CVE-2026-102342?** Yes. ammonia (crates.io): upgrade to 3.3.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-102342 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-102342?** Check whether you run Ammonia Project Ammonia or ammonia (crates.io) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- ammonia (crates.io): upgrade to 3.3.3 or later

  ```sh
  cargo update -p ammonia
  ```


## Technical details

Ammonia fails to strip or neutralize the SVG animate and set elements when they manipulate link href attributes to javascript: schemes. An unauthenticated network attacker with low privileges can store malicious SVG markup; when a user clicks the resulting link, the JavaScript executes in their browser context. Patches exist in versions 3.3.3, 4.0.3, and 4.1.4.

## Affected products

- Ammonia Project Ammonia < 3.3.2, >= 4.0.0 and <= 4.0.2, >= 4.1.2 and <= 4.1.3

## Identifiers

- CVE-2026-102342
- GHSA-m6mh-2hw2-555x

## Timeline

- 2026-09-29: disclosed

## References

- [https://api.github.com/users/koyokr](https://api.github.com/users/koyokr)

## Related threats

- [Rust Ammonia XSS via MathML annotation-xml encoding strip](https://junglewise.ai/threats/cve-2026-63430-rustsec-2026-0193-mxss-in-ammonia-via-mathml-annotation-xml)
- [ammonia CSS url function case-sensitivity bypass](https://junglewise.ai/threats/rustsec-2026-0373-missing-case-insensitive-matching-for-css-url-0b78f36f)
- [RUSTSEC-2026-0213 - XSS in ammonia via SVG `animate` and `set` animation tags](https://junglewise.ai/threats/rustsec-2026-0213-xss-in-ammonia-via-svg-animate-and-set-animation-tags-3d7360b1)
- [Ammonia incorrectly handles embedded SVG and MathML leading to mutation XSS after removal](https://junglewise.ai/threats/ammonia-incorrectly-handles-embedded-svg-and-mathml-leading-to-mutation-c72e022f)
- [RUSTSEC-2025-0071 - Incorrect handling of embedded SVG and MathML leads to mutation XSS after removal](https://junglewise.ai/threats/rustsec-2025-0071-incorrect-handling-of-embedded-svg-and-mathml-leads-d1eb16ba)
