GHSA-2RXC-GJRP-VJHX
Vulnerability from github – Published: 2024-12-04 18:31 – Updated: 2024-12-04 18:31
VLAI?
Summary
Unsoundness in anstream
Details
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.
{
"affected": [
{
"package": {
"ecosystem": "crates.io",
"name": "anstream"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.6.8"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [],
"github_reviewed": true,
"github_reviewed_at": "2024-12-04T18:31:31Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "When given a valid UTF8 string \"\u00f6\\x1b\ud83d\ude00\", 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.\n\nWhen looping over \"non-printable bytes\" \\x1b\\xf0 will be considered as some non-printable sequence.\n\nThis will produce a broken str from the incorrectly segmented bytes via str::from_utf8_unchecked, and that should never happen.\n\nFull credit goes to @Ralith who reviewed this code and asked @burakemir to follow up.",
"id": "GHSA-2rxc-gjrp-vjhx",
"modified": "2024-12-04T18:31:31Z",
"published": "2024-12-04T18:31:31Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/rust-cli/anstyle/issues/156"
},
{
"type": "PACKAGE",
"url": "https://github.com/rust-cli/anstyle"
},
{
"type": "WEB",
"url": "https://rustsec.org/advisories/RUSTSEC-2024-0404.html"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "Unsoundness in anstream"
}
Loading…
Loading…
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
Loading…