CVE-2023-28631: Comrak AST node data is not validated (GHSL-2023-049)
5.3
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.48036%
CWE
Published
3/28/2023
Updated
5/1/2023
KEV Status
No
Technology
Rust
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| comrak | rust | < 0.17.0 | 0.17.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from AST nodes storing unvalidated byte arrays (Vec<u8>) that were assumed to be valid UTF-8. The HTML formatter functions directly processed these raw bytes without validation. Key functions in html.rs (format_text, format_code, etc.) were modified in the patch to use String fields' .as_bytes() instead of raw Vec<u8>, indicating they previously handled unvalidated bytes. These functions would crash or misbehave when given non-UTF-8 data through manually constructed ASTs, which is exactly the attack vector described in GHSL-2023-049.