CVE-2021-39199
JSON

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 packageVersionsReported by
remarkjs remark-html>= 14.0.0, < 14.0.1, < 13.0.2CVE List
remark-html (npm)before 13.0.2, from 14.0.0 before 14.0.1GitHub Advisory Database
remark remark-htmlbefore 13.0.2, from 14.0.0 before 14.0.1NVD

All scores

GitHub_M10.0critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
GitHub10.0critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/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

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:

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

Sources

SourceRecordLicence
CVE ListCVE-2021-39199 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-9q5w-79cv-947m changed 2026-07-08CC-BY-4.0
NVDCVE-2021-39199 changed 2026-06-17Public domain