10.0critical
Cross site scripting via unsafe defaults in remark-html
- Severity
- 10.0critical CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.07% (higher than 65% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-9q5w-79cv-947m
Description
remark-html is an open source nodejs library which compiles Markdown to HTML. In affected versions the documentation of remark-html has mentioned that it was safe by default. In practice the default was never safe and had to be opted into. That is, user input was not sanitized. This means arbitrary HTML can be passed through leading to potential XSS attacks. The problem has been patched in 13.0.2 and 14.0.1: `remark-html` is now safe by default, and the implementation matches the documentation. On older affected versions, pass `sanitize: true` if you cannot update.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| remarkjs remark-html | >= 14.0.0, < 14.0.1, < 13.0.2 | CVE List |
| remark-html (npm) | before 13.0.2, from 14.0.0 before 14.0.1 | GitHub Advisory Database |
| remark remark-html | before 13.0.2, from 14.0.0 before 14.0.1 | NVD |
All scores
| GitHub_M | 10.0critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N |
| GitHub | 10.0critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/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
remark-html is an open source nodejs library which compiles Markdown to HTML. In affected versions the documentation of remark-html has mentioned that it was safe by default. In practice the default was never safe and had to be opted into. That is, user input was not sanitized. This means arbitrary HTML can be passed through leading to potential XSS attacks. The problem has been patched in 13.0.2 and 14.0.1: `remark-html` is now safe by default, and the implementation matches the documentation. On older affected versions, pass `sanitize: true` if you cannot update.
GitHub Advisory Database
Impact
The documentation of remark-html has mentioned that it was safe by default. In practise the default was never safe and had to be opted into. This means arbitrary HTML can be passed through leading to potential XSS attacks.
Patches
The problem has been patched in 13.0.2 and 14.0.1: remark-html is now safe by default, and the implementation matches the documentation.
Workarounds
On older affected versions, pass sanitize: true, like so:
- .use(remarkHtml)
+ .use(remarkHtml, {sanitize: true})
References
n/a
For more information
If you have any questions or comments about this advisory:
- Open an issue in
remark-html - Email us at security@unifiedjs.com
NVD (es)
remark-html es una librería nodejs de código abierto que compila Markdown a HTML. En las versiones afectadas, la documentación de remark-html mencionaba que era segura por defecto. En la práctica, nunca fue segura por defecto y había que optar por ella. Es decir, la entrada del usuario no era saneada. Esto significa que se puede pasar HTML arbitrario, conllevando a potenciales ataques de tipo XSS. El problema ha sido parcheado en las versiones 13.0.2 y 14.0.1: "remark-html" es ahora seguro por defecto, y la implementación coincide con la documentación. En versiones anteriores afectadas, pase "sanitize: true" si no puede actualizar
References
| https://github.com/remarkjs/remark-html/security/advisories/GHSA-9q5w-79cv-947m | patch, third-party-advisory, web | |
| https://github.com/remarkjs/remark-html/commit/b75c9dde582ad87ba498e369c033dc8a350478c1 | patch, third-party-advisory, web | |
| https://github.com/remarkjs/remark-html/releases/tag/14.0.1 | patch, release-notes, third-party-advisory, web | |
| https://www.npmjs.com/package/remark-html | product, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-39199 | advisory | |
| https://github.com/remarkjs/remark-html | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-39199 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-9q5w-79cv-947m changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-39199 changed 2026-06-17 | Public domain |