CVE-2021-38186
JSON

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 packageVersionsReported by
Unspecified productn/aCVE List
comrak (crates.io)before 0.10.1, from 0.0.0-0 before 0.10.1GitHub Advisory Database, RustSec Advisory Database
comrak_project comrakbefore 0.10.1NVD

All scores

GitHub6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
NVD4.3medium CVSS:2.0AV: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. &#x64&#x61&#x74&#x61&#x3a. 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

Sources

SourceRecordLicence
CVE ListCVE-2021-38186 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-6wj2-g87r-pm62 changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2021-0063 changed 2023-11-08CC0-1.0
NVDCVE-2021-38186 changed 2026-06-17Public domain