6.1medium
Cross-site Scripting in comrak
- Severity
- 6.1medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.74% (higher than 55% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-6wj2-g87r-pm62RUSTSEC-2021-0063
Description
An issue was discovered in the comrak crate before 0.10.1 for Rust. It mishandles & characters, leading to XSS via &# HTML entities.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| comrak (crates.io) | before 0.10.1, from 0.0.0-0 before 0.10.1 | GitHub Advisory Database, RustSec Advisory Database |
| comrak_project comrak | before 0.10.1 | NVD |
All scores
| GitHub | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Classification
What each source says
CVE List
An issue was discovered in the comrak crate before 0.10.1 for Rust. It mishandles & characters, leading to XSS via &# HTML entities.
RustSec Advisory Database
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.
NVD (es)
Se ha detectado un problema en la crate comrak versiones anteriores a 0.10.1 para Rust. Maneja inapropiadamente los caracteres &, conllevando a un ataque de tipo XSS por medio de entidades &# HTML
References
| https://rustsec.org/advisories/RUSTSEC-2021-0063.html | advisory, exploit, issue-tracking, patch, third-party-advisory, web | |
| https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/comrak/RUSTSEC-2021-0063.md | third-party-advisory | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-38186 | advisory | |
| https://github.com/kivikakk/comrak/commit/b72340cabe4749952530b4fb6b4fcc706bc973e5 | web | |
| https://github.com/kivikakk/comrak | package | |
| https://github.com/kivikakk/comrak/compare/0.10.0...0.10.1 | web | |
| https://github.com/kivikakk/comrak/releases/tag/0.10.1 | web | |
| https://crates.io/crates/comrak | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-38186 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-6wj2-g87r-pm62 changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2021-0063 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2021-38186 changed 2026-06-17 | Public domain |