{"id":"CVE-2021-38186","aliases":["CVE-2021-38186","GHSA-6wj2-g87r-pm62","RUSTSEC-2021-0063"],"related":[],"kind":"vulnerability","state":"published","title":"Cross-site Scripting in comrak","summary":"An issue was discovered in the comrak crate before 0.10.1 for Rust. It mishandles & characters, leading to XSS via &# HTML entities.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An issue was discovered in the comrak crate before 0.10.1 for Rust. It mishandles & characters, leading to XSS via &# HTML entities.","source":"cvelist"},{"lang":"en","text":"[comrak](https://github.com/kivikakk/comrak) operates by default in a \"safe\"\nmode of operation where unsafe content, such as arbitrary raw HTML or URLs with\nnon-standard schemes, are not permitted in the output.  This is per the\nreference GFM implementation, [cmark-gfm](https://github.com/github/cmark).\n\nAmpersands were not being correctly escaped in link targets, making it possible\nto fashion unsafe URLs using schemes like `data:` or `javascript:` by entering\nthem as HTML entities, e.g. `&#x64&#x61&#x74&#x61&#x3a`.  The intended\nbehaviour, demonstrated upstream, is that these should be escaped and therefore\nharmless, but this behaviour was broken in comrak.","format":"markdown","source":"rustsec"},{"lang":"es","text":"Se ha detectado un problema en la crate comrak versiones anteriores a 0.10.1 para Rust. Maneja inapropiadamente los caracteres &amp;, conllevando a un ataque de tipo XSS por medio de entidades &amp;# HTML","source":"nvd"}],"published":"2021-05-04T12:00:00.000Z","modified":"2026-06-17T04:01:43.127Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.10.1"}],"ecosystem":"crates.io","package":"comrak","purl":"pkg:cargo/comrak","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.10.1"}],"ecosystem":"crates.io","package":"comrak","purl":"pkg:cargo/comrak","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"0.10.1"}],"vendor":"comrak_project","product":"comrak","cpe":"cpe:2.3:a:comrak_project:comrak:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0063.html","tags":["advisory","exploit","issue-tracking","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/comrak/RUSTSEC-2021-0063.md","tags":["third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-38186","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/kivikakk/comrak/commit/b72340cabe4749952530b4fb6b4fcc706bc973e5","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/kivikakk/comrak","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/kivikakk/comrak/compare/0.10.0...0.10.1","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/kivikakk/comrak/releases/tag/0.10.1","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/comrak","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-38186","url":"https://www.cve.org/CVERecord?id=CVE-2021-38186","licence":"CVE Terms of Use","modified":"2024-08-04T01:37:15.492Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6wj2-g87r-pm62","url":"https://github.com/advisories/GHSA-6wj2-g87r-pm62","licence":"CC-BY-4.0","modified":"2023-11-08T04:06:25.615Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2021-0063","url":"https://rustsec.org/advisories/RUSTSEC-2021-0063.html","licence":"CC0-1.0","modified":"2023-11-08T04:06:25.615Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-38186","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-38186","licence":"Public domain","modified":"2026-06-17T04:01:43.127Z"}],"updatedAt":"2026-11-25T22:58:03.053Z","epss":{"score":0.00741,"percentile":0.55868,"date":"2026-12-01T12:00:22.000Z"}}