Vulnerability MediumRUSTSEC-2021-0063 · comrak
RUSTSEC-2021-0063: XSS in `comrak`
Short answerA security vulnerability in the comrak crate: XSS in `comrak`. GitHub rates it Medium. Fixed in 0.10.1: update to a fixed version.
| Crate | comrak |
|---|---|
| Type | Vulnerability (format-injection) |
| Affected versions | Before 0.10.1. |
| Fixed in | 0.10.1 |
| Severity | Medium (GitHub rating) |
| Published | 2021-05-04 |
| Last changed | 2023-11-08 |
| Also known as | CVE-2021-38186, GHSA-6wj2-g87r-pm62 |
What to do
- See which version you have:
cargo tree -i comrak(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p comrak. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplecomrak = "0.10.1") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
comrak operates by default in a "safe" mode of operation where unsafe content, such as arbitrary raw HTML or URLs with non-standard schemes, are not permitted in the output. This is per the reference GFM implementation, cmark-gfm.
Ampersands were not being correctly escaped in link targets, making it possible to fashion unsafe URLs using schemes like data: or javascript: by entering them as HTML entities, e.g. data:. The intended behaviour, demonstrated upstream, is that these should be escaped and therefore harmless, but this behaviour was broken in comrak.
References
- Package: crates.io/crates/comrak
- Advisory: rustsec.org/advisories/RUSTSEC-2021-0063.html
- Web: github.com/kivikakk/comrak/releases/tag/0.10.1
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for comrak
- Vulnerability MediumRUSTSEC-2021-0026 · 2021-02-21XSS in `comrak`
- VulnerabilityGHSA-5r3x-p7xx-x6q5 · 2023-03-28Comrak AST node data is not validated (GHSL-2023-049)
- VulnerabilityGHSA-8hqf-xjwp-p67v · 2023-03-28Comrak vulnerable to quadratic runtime issues when parsing Markdown (GHSL-2023-047)
- VulnerabilityGHSA-xxmq-4vph-956w · 2023-03-28Comrak vulnerable to production of excessive output when parsing Markdown (GHSL-2023-048)
Up next
Same cratecomrak: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?