Advisory

GHSA-p2g9-94wh-65c2

Also known as: RUSTSEC-2022-0003

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

Medium Basis: The source's own band: MODERATE

Dates

Published
2022-06-16 23:39 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: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences