Skip to content

GHSA-5hp8-35wj-m525 CVE-2019-15542 RUSTSEC-2019-0001

Uncontrolled recursion in ammonia

High crates.io
Severity
7.5 / 10
High · CVSS 3.0
Exploit chance (EPSS)
1.41%
Chance of exploitation in the next 30 days. Higher than 72.68% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-674 Uncontrolled Recursion
Fix
2.1.0
Upgrade ammonia to this version or later

Description

An issue was discovered in the ammonia crate before 2.1.0 for Rust. There is uncontrolled recursion during HTML DOM tree serialization.

Affected versions

crates.io

PackageVulnerableFixed in
ammonia
< 2.1.0
2.1.0
ammonia
>= 0.0.0-0, < 2.1.0
2.1.0

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

ammonia crates.io → 2.1.0

cargo
cargo update -p ammonia --precise 2.1.0

Severity breakdown

CVSS 3.0 7.5

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Weakness

CWE-674: Uncontrolled Recursion

The product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack.

How to prevent it
  • Implementation: Ensure that an end condition will be reached under all logic conditions. The end condition may include checking against the depth of recursion and exiting with an error if the recursion goes too deep. The complexity of the end condition contributes to the effectiveness of this action.
  • Implementation: Increase the stack size.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
RUSTSEC-2026-0373
Missing case-insensitive matching for CSS url function
Not rated yet Also affects ammonia
GHSA-m6mh-2hw2-555x
Ammonia: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Medium Also affects ammonia
GHSA-9jh8-v38h-cvhr
ammonia: mXSS via MathML `annotation-xml` encoding strip
Medium Also affects ammonia
GHSA-mm7x-qfjj-5g2c
Ammonia incorrectly handles embedded SVG and MathML leading to mutation XSS after removal
Low Also affects ammonia
GHSA-p2g9-94wh-65c2
Space bug in `clean_text`
Medium Also affects ammonia
RUSTSEC-2021-0157
Incorrect escaping for `url("")` functions in CSS style attributes
Not rated yet Also affects ammonia
RUSTSEC-2021-0158
XSS in ammonia via SVG `animateMotion`, `animateTransform`, and/or `animateColor` tags
Not rated yet Also affects ammonia
GHSA-5325-xw5m-phm3
Cross-site Scripting in ammonia
Medium Also affects ammonia
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor