Advisory

GHSA-9q5w-79cv-947m

Also known as: CVE-2021-39199

Summary

Unsafe defaults in remark-html

Details

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:

Severity

Critical Basis: The source's own band: CRITICAL

Dates

Published
2021-09-07 23:10 UTC
Modified
2026-07-08 06:28 UTC

Affected packages and fixes

remark-html

npm · All systems

Affected

  • introduced 0, fixed 13.0.2 (semver)

Fixed versions

13.0.2

Fix

remark-html

npm · All systems

Affected

  • introduced 14.0.0, fixed 14.0.1 (semver)

Fixed versions

14.0.1

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences