# CVE-2021-38193: Cross-site Scripting in ammonia

- Severity: Medium 6.1 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.70%, higher than 54% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-07-08T12:00:00.000Z
- Modified: 2026-06-17T04:01:43.997Z
- Also known as: GHSA-5325-xw5m-phm3, RUSTSEC-2021-0074
- Weaknesses: CWE-79
- Assigned by: mitre

## Description

An issue was discovered in the ammonia crate before 3.1.0 for Rust. XSS can occur because the parsing differences for HTML, SVG, and MathML are mishandled, a similar issue to CVE-2020-26870.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- ammonia (crates.io): from 3.0.0 before 3.1.0; before 2.1.3; from 0.0.0-0 before 2.1.3
- ammonia_project ammonia: before 3.1.0

## Every score

- GitHub: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:P/A:N`

## References

- <https://rustsec.org/advisories/RUSTSEC-2021-0074.html> (exploit, advisory, issue-tracking, patch, third-party-advisory, web)
- <https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/ammonia/RUSTSEC-2021-0074.md> (third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-38193> (advisory)
- <https://github.com/rust-ammonia/ammonia/pull/142> (web)
- <https://github.com/rust-ammonia/ammonia> (package)
- <https://crates.io/crates/ammonia> (package)

## Sources

- CVE List: [CVE-2021-38193](https://www.cve.org/CVERecord?id=CVE-2021-38193), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-5325-xw5m-phm3](https://github.com/advisories/GHSA-5325-xw5m-phm3), CC-BY-4.0, modified 2023-11-08
- RustSec Advisory Database: [RUSTSEC-2021-0074](https://rustsec.org/advisories/RUSTSEC-2021-0074.html), CC0-1.0, modified 2023-11-08
- NVD: [CVE-2021-38193](https://nvd.nist.gov/vuln/detail/CVE-2021-38193), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-38193 · Whole record: https://cve.day/CVE-2021-38193.json · Rebuilt by cve.day 2026-11-25T22:58:03.055Z
