Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS05cTV3LTc5Y3YtOTQ3bc0Vog

Unsafe defaults in `remark-html`

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:

Permalink: https://github.com/advisories/GHSA-9q5w-79cv-947m
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS05cTV3LTc5Y3YtOTQ3bc0Vog
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Critical
Classification: General
Published: over 2 years ago
Updated: about 1 year ago


CVSS Score: 10.0
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N

Identifiers: GHSA-9q5w-79cv-947m, CVE-2021-39199
References: Repository: https://github.com/remarkjs/remark-html
Blast Radius: 43.1

Affected Packages

npm:remark-html
Dependent packages: 543
Dependent repositories: 20,403
Downloads: 1,593,311 last month
Affected Version Ranges: = 14.0.0, < 13.0.2
Fixed in: 14.0.1, 13.0.2
All affected versions: 2.0.0, 2.0.2, 3.0.0, 3.0.1, 4.0.0, 5.0.0, 5.0.1, 5.1.0, 5.2.0, 6.0.0, 6.0.1, 7.0.0, 8.0.0, 9.0.0, 9.0.1, 10.0.0, 11.0.0, 11.0.1, 11.0.2, 12.0.0, 13.0.0, 13.0.1, 14.0.0
All unaffected versions: 13.0.2, 14.0.1, 15.0.0, 15.0.1, 15.0.2, 16.0.0, 16.0.1