Attacker controlled data in AST nodes is not validated in comrak
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub.
Summary
comrak is a CommonMark + GFM compatible Markdown parser and renderer written in rust. A Comrak AST can be constructed manually by a program instead of parsing a Markdown document with `parse_document`. This AST can then be converted to HTML via `html::format_document_with_plugins`. However, the HTML formatting code assumes that the AST is well-formed. For example, many AST notes contain `[u8]` fields which the formatting code assumes is valid UTF-8 data. Several bugs can be triggered if this is not the case. Version 0.17.0 contains adjustments to the AST, storing strings instead of unvalidated byte arrays. Users are advised to upgrade. Users unable to upgrade may manually validate UTF-8 correctness of all data when assigning to `&[u8]` and `Vec<u8>` fields in the AST. This issue is also tracked as `GHSL-2023-049`.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| kivikakk | comrak | before 0.17.0 | 0.17.0 | Patch available | CNA |
| — | comrak (crates.io) | before 0.17.0 | 0.17.0 | Patch available | GHSA-5r3x-p7xx-x6q5 |
- comrak Vendorkivikakk Affected before 0.17.0 Fixed in 0.17.0 Patch available CNA
- comrak (crates.io) Vendor— Affected before 0.17.0 Fixed in 0.17.0 Patch available GHSA-5r3x-p7xx-x6q5
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:comrak_project:comrak:*:*:*:*:*:rust:*:* | before 0.17.0 | Vulnerable | Comrak Project |
- cpe:2.3:a:comrak_project:comrak:*:*:*:*:*:rust:*:* Versions before 0.17.0 Vulnerable ·Comrak Project
Remediation
- Fix · CNA comrak (kivikakk) Fixed in 0.17.0
- Fix · GHSA-5r3x-p7xx-x6q5 comrak (crates.io) Fixed in 0.17.0 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2023-28631
- 2026-10-03 Alias added: GHSA-5r3x-p7xx-x6q5
References
Advisory 2
Other 8
- https://lists.fedoraproject.org/archives/list/[email protected]/message/PTWZWCT7KCX2KTXTLPUYZ3EHOONG4X46/
- https://lists.fedoraproject.org/archives/list/[email protected]/message/OUYME2VA555X6567H7ORIJQFN4BVGT6N/
- https://lists.fedoraproject.org/archives/list/[email protected]/message/VQ3UBC7LE4VPCMZBTADIBL353CH7CPVV/
- https://github.com/kivikakk/comrak
- https://github.com/kivikakk/comrak/releases/tag/0.17.0
- https://lists.fedoraproject.org/archives/list/[email protected]/message/OUYME2VA555X6567H7ORIJQFN4BVGT6N
- https://lists.fedoraproject.org/archives/list/[email protected]/message/PTWZWCT7KCX2KTXTLPUYZ3EHOONG4X46
- https://lists.fedoraproject.org/archives/list/[email protected]/message/VQ3UBC7LE4VPCMZBTADIBL353CH7CPVV
More Comrak Project Comrak vulnerabilities
- TI-2023-13145 Quadratic runtime when parsing Markdown in comrak CVSS 3.1HIGH 7.5
- TI-2021-15863 An issue was discovered in the comrak crate before 0.10.1 for Rust. CVSS 3.1MEDIUM 6.1
- TI-2021-09116 An issue was discovered in the comrak crate before 0.9.1 for Rust. CVSS 3.1MEDIUM 6.1
Sources
- CVE-2023-28631 · CVE Program
- CVE-2023-28631 · NVD
- FIRST EPSS
- GHSA-5r3x-p7xx-x6q5 · GitHub Advisory Database · CC BY 4.0
- CVE-2023-28631 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences