RUSTSEC-2022-0003

Source
https://rustsec.org/advisories/RUSTSEC-2022-0003
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2022-0003.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2022-0003
Aliases
Published
2022-01-19T12:00:00Z
Modified
2023-11-08T04:21:23.389784Z
Summary
Space bug in `clean_text`
Details

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.

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / ammonia

Package

Affected ranges

Type
SEMVER
Events
Introduced
3.0.0
Fixed
3.1.3

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "os": [],
        "functions": [
            "ammonia::clean_text"
        ],
        "arch": []
    }
}

Database specific

{
    "cvss": null,
    "informational": null,
    "categories": [
        "format-injection"
    ]
}