Advisory

RUSTSEC-2022-0003

Also known as: GHSA-p2g9-94wh-65c2

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.

Severity

Not rated by the source.

Dates

Published
2022-01-19 12:00 UTC
Modified
2023-11-08 04:21 UTC

Affected packages and fixes

ammonia

crates.io · All systems

Affected

  • introduced 3.0.0, fixed 3.1.3 (semver)

Fixed versions

3.1.3

Fix

  • Fixed version 3.1.3
    cargo update -p ammonia --precise 3.1.3

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences