Regular Expression Denial of Service (REDoS) in Marked
Published 8 Feb 2021 · Updated 10 Sept 2026
Affected package
- Affected
- >=1.1.1 <2.0.0
- Fixed in
- 2.0.0
npm install marked@2.0.0Details
Impact
_What kind of vulnerability is it? Who is impacted?_
Regular expression Denial of Service
A Denial of Service attack can affect anyone who runs user generated code through marked.
Patches
_Has the problem been patched? What versions should users upgrade to?_
patched in v2.0.0
Workarounds
_Is there a way for users to fix or remediate the vulnerability without upgrading?_
None.
References
_Are there any links users can visit to find out more?_
https://github.com/markedjs/marked/issues/1927 https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
For more information
If you have any questions or comments about this advisory:
- Open an issue in marked
Is GHSA-4r62-v4vq-hr96 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected marked, and gives you the command that fixes it.
References
- Linkgithub.com/markedjs/marked/security/advisories/GHSA-4r62-v4vq-hr96
- Advisorynvd.nist.gov/vuln/detail/CVE-2021-21306
- Linkgithub.com/markedjs/marked/issues/1927
- Linkgithub.com/markedjs/marked/pull/1864
- Linkgithub.com/markedjs/marked/commit/7293251c438e3ee968970f7609f1a27f9007bccd
- Linkwww.npmjs.com/package/marked
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.