logo

GHSA-2rxc-gjrp-vjhx – anstream

Package

Manager: cargo
Name: anstream
Vulnerable Version: >=0 <0.6.8

Severity

Level: Medium

CVSS v3.1: CVSS:3.1/AV:A/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L/E:P/RL:O/RC:C

CVSS v4.0: CVSS:4.0/AV:A/AC:H/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

EPSS: N/A pctlN/A

Details

Unsoundness in anstream When given a valid UTF8 string "ΓΆ\x1bπŸ˜€", the function in crates/anstream/src/adapter/strip.rs will be confused. The UTF8 bytes are \xc3\xb6 then \x1b then \xf0\x9f\x98\x80. When looping over "non-printable bytes" \x1b\xf0 will be considered as some non-printable sequence. This will produce a broken str from the incorrectly segmented bytes via str::from_utf8_unchecked, and that should never happen. Full credit goes to @Ralith who reviewed this code and asked @burakemir to follow up.

Metadata

Created: 2024-12-04T18:31:31Z
Modified: 2024-12-04T18:31:31Z
Source: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/12/GHSA-2rxc-gjrp-vjhx/GHSA-2rxc-gjrp-vjhx.json
CWE IDs: []
Alternative ID: N/A
Finding: F316
Auto approve: 1