GHSA-p2g9-94wh-65c2
JSON

medium

Space bug in `clean_text`

Severity
medium rating by GitHub
Published
Last changed
Also known as
RUSTSEC-2022-0003

Description

An incorrect mapping from HTML specification to ASCII codes was used. Because HTML treats the Form Feed as whitespace, code like this has an injection bug:

let html = format!("<div title={}>", clean_text(user_supplied_string));

Applications are not affected if they quote their attributes, or if they don't use clean_text at all.

Affected

Product or packageVersionsReported by
ammonia (crates.io)from 3.0.0 before 3.1.3GitHub Advisory Database, RustSec Advisory Database

Classification

References

Sources

SourceRecordLicence
GitHub Advisory DatabaseGHSA-p2g9-94wh-65c2 changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2022-0003 changed 2023-11-08CC0-1.0