Skip to main content

Ammonia CVE-2026-102342

| EUVDEUVD-2026-98766 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-09-29 https://github.com/rust-ammonia/ammonia GHSA-m6mh-2hw2-555x
5.4
CVSS 3.1 · Vendor: https://github.com/rust-ammonia/ammonia
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate to app accepting SVG content
  2. Delivery
    Submit crafted SVG with set/animate attributeName=href
  3. Exploit
    Sanitizer passes javascript: URL onto link
  4. Execution
    Payload stored and served to victims
  5. Persist
    Victim clicks link
  6. Impact
    Script executes in victim session

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the consuming application to have explicitly added the SVG animate and set tags to ammonia's tag whitelist - these are NOT permitted by ammonia's default configuration, so default deployments are unaffected. Given that, an attacker who can submit stored content crafts an SVG whose <set>/<animate> element uses attributeName="href" with a to/values/from value of javascript:..., which bypasses the URL-scheme sanitizer because attributeName-driven animation targets were not validated. Exploitation is further limited by requiring a privileged/authenticated submission path (PR:L) and by requiring the victim to actively click the resulting link (UI:R). The vendor workaround (do not enable animate/set) fully mitigates without upgrading.

Impact

This is a genuine but modestly-scoped vulnerability. The CVSS 3.1 vector (AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N, 5.4 Medium) reflects a stored XSS that is network-reachable and low-complexity but gated by two real limiters: it requires an authenticated/privileged content submitter (PR:L - the attacker must be able to get sanitized-then-stored SVG content into the application) and victim user interaction (UI:R - the victim must click the malicious link). The scope change (S:C) is appropriate because ammonia is a sanitization library whose job is to protect a downstream rendering context (the browser DOM/other users' sessions). No EPSS score, KEV listing, or public exploit is reported, so this is no public exploit identified at time of analysis - though a working proof-of-concept SVG is embedded directly in the vendor advisory, making weaponization trivial for anyone motivated. Crucially, the affected code path is NOT default: ammonia does not whitelist the SVG animate/set tags out of the box, so only applications that explicitly opted into those tags are exposed. There is no signal conflict in the data; the vendor CVSS aligns with the description. This is a real defect to patch promptly in affected deployments, but it is a low-to-medium real-world priority rather than a critical fire-drill.

Exploit ScenarioDerived

An attacker with the ability to submit content to an application that uses ammonia with the SVG animate/set tags whitelisted embeds a crafted SVG whose <set> element sets attributeName="href" to="javascript:..." on an <a> link; ammonia's URL-scheme filter never inspects this animation-injected value, so the malicious link survives sanitization and is stored. When another user views the content and clicks the link, the javascript: URL executes in their session. A ready-to-use proof-of-concept SVG is published in the GHSA advisory, but no exploitation in the wild is reported.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 29, 2026

Stored cross-site scripting in the Ammonia Rust HTML sanitizer affects versions 3.3.2 and earlier, 4.0.0 through 4.0.2, and 4.1.2 through 4.1.3 when a consuming application has explicitly whitelisted the SVG animate and set tags. An authenticated attacker with a content-submission path can craft an SVG whose <set> element sets attributeName="href" with a javascript: value, surviving sanitization because animation-target attribute names were never validated; the payload only fires if the victim clicks the resulting link (UI:R), yielding a scoped cross-site scripting impact (C:L/I:L). Ammonia's default configuration does not permit animate or set, so out-of-the-box deployments are unaffected, and no public exploit code or confirmed active exploitation was identified at time of analysis.

RemediationAI

Vendor-released patches are available for all three affected lines: upgrade ammonia to 3.3.3 (from 3.3.2 and earlier), 4.0.3 (from the 4.0.x range), or 4.1.4 (from the 4.1.x range), which add explicit validation of attributeName, values, from, and to on SVG animate/set elements via the fixes in PRs 250, 251, and 252 and the associated commits. The most direct compensating control, confirmed by the vendor, is to remove animate and set from any custom tag whitelist passed to ammonia's Builder::add_tags/rm_tags configuration - since these tags are not enabled by default, this workaround fully eliminates the attack surface with no functional loss for applications that never intended to allow SVG animation, though it will break legitimate SVG animation content if such content is required. Because exploitation depends on an authenticated content-submission path and on the victim clicking the injected link, additional defense-in-depth is to enforce a strict Content-Security-Policy that omits unsafe-inline and disallows javascript: script sources, and to re-sanitize or strip stored SVG content that predates the upgrade. Advisory references: https://github.com/rust-ammonia/ammonia/security/advisories/GHSA-m6mh-2hw2-555x, https://github.com/advisories/GHSA-m6mh-2hw2-555x, and https://rustsec.org/advisories/RUSTSEC-2026-0213.html.

Affected VersionsENISA

ammonia 4.1.2, < 4.1.4
ammonia 4.0.0, < 4.0.3
ammonia < 3.3.3

Affected Packages

cargo ammonia fix: 3.3.3, 4.0.3, 4.1.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in cargo

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Ammonia is a Rust HTML sanitization library commonly used to clean untrusted, user-supplied markup before rendering (for example in web applications and comment systems). The root cause is CWE-79 (Improper Neutralization of Input During Web Page Generation), realized specifically as a URL-scheme bypass: Ammonia's attribute filter applies is_url_attr and scheme checks to attributes present literally on an element, but did not track attributes injected at runtime by SVG animation elements. SVG's <set> and <animate> elements carry an attributeName plus to/from/values, which the SVG engine applies to a target element after parsing - so a <set attributeName="href" to="javascript:..."> inside an <a> produces an href the sanitizer never inspected. The upstream fix (PRs 250, 251, 252 and commits 9394bd8, 9e3335e, d2ae154) builds an id-to-tag-name map over the DOM, threads parent context through clean_child/adjust_node_attributes, and explicitly validates attributeName/values/from/to on svg-namespaced animate and set elements. The CPE records identify the affected component as pkg:rust/ammonia; the CVSS 3.1 vector CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N indicates a network-reachable, low-complexity issue requiring authenticated submission privileges and victim interaction, with changed scope and low confidentiality/integrity impact, and no availability impact.

Know when Rust gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/rust-ammonia/ammonia) PRIMARY 5.4 MEDIUM
AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
vuln.today AI 5.4 MEDIUM

Network-delivered stored content (AV:N) with low complexity; submitter privilege needed (PR:L) and victim click required (UI:R); sanitizer bypass affects downstream browser context (S:C) with limited script-based C/I impact and no availability effect.

3.1 AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
Red Hat 5.4 MEDIUM

Primary rating from Vendor (https://github.com/rust-ammonia/ammonia).

CVSS VectorVendor: https://github.com/rust-ammonia/ammonia

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

DescriptionCVE.org

The following SVG will produce a link with a javascript scheme. If the user clicks this link, they will run it.

svg
<svg xmlns="http://www.w3.org/2000/svg">
  <a>
    <set attributeName="href" to="javascript:alert('SET_XSS')"></set>
    <text y="30">Click set</text>
  </a>
</svg>

Impact

Allows stored XSS in applications that allow the animate and set tags.

Patches

Fixed in 3.3.3, 4.0.3, and 4.1.4

Workarounds

Do not enable the animate or set tags.

Threat Intelligence Overview

EPSS Score
0.4%
Top 72% exploitable
Prevalence
Medium
popular Rust HTML sanitization crate, but only affects apps whitelisting SVG animate/set
Threat Intel
1
1 sources
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

27
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +27
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

More in Rust

View all
CVE-2024-3566 CRITICAL POC
9.8 Apr 10

Command injection via Windows CreateProcess argument parsing affects multiple language runtimes and tooling (Node.js, PH

CVE-2021-31162 CRITICAL POC
9.8 Apr 14

In the standard library in Rust before 1.52.0, a double free can occur in the Vec::from_iter function if freeing the ele

CVE-2021-28879 CRITICAL POC
9.8 Apr 11

In the standard library in Rust before 1.52.0, the Zip implementation can report an incorrect size due to an integer ove

CVE-2026-58491 CRITICAL POC
9.3 Sep 21

Stored cross-site scripting and open redirect in Warpgate's SSO endpoints (versions prior to 0.25.5) allow an unauthenti

CVE-2021-29922 CRITICAL POC
9.1 Aug 07

library/std/src/net/parser.rs in Rust before 1.53.0 does not properly consider extraneous zero characters at the beginni

CVE-2026-77620 HIGH POC
8.7 Sep 22

Denial of service in the Vector observability pipeline's `logstash` source (versions 0.15.0 through 0.56.x) allows a rem

CVE-2019-12083 HIGH POC
8.1 May 13

The Rust Programming Language Standard Library 1.34.x before 1.34.2 contains a stabilized method which, if overridden, c

CVE-2021-28878 HIGH POC
7.5 Apr 11

In the standard library in Rust before 1.52.0, the Zip implementation calls __iterator_get_unchecked() more than once fo

CVE-2021-28875 HIGH POC
7.5 Apr 11

In the standard library in Rust before 1.50.0, read_to_end() does not validate the return value from Read in an unsafe c

CVE-2019-16760 HIGH POC
7.5 Sep 30

Cargo prior to Rust 1.26.0 may download the wrong dependency if your package.toml file uses the `package` configuration

CVE-2024-24576 CRITICAL POC
10.0 Apr 09

Rust is a programming language. Rated critical severity (CVSS 10.0), this vulnerability is remotely exploitable, no auth

CVE-2018-1000810 CRITICAL
9.8 Oct 08

The Rust Programming Language Standard Library version 1.29.0, 1.28.0, 1.27.2, 1.27.1, 127.0, 126.2, 126.1, 126.0 contai

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy