CVE-2022-21681
Exponential catastrophic backtracking (ReDoS) in marked
Marked is a markdown parser and compiler. Prior to version 4.0.10, the regular expression inline.reflinkSearch may cause catastrophic backtracking against some strings and lead to a denial of service (DoS). Anyone who runs untrusted markdown through a vulnerable version of marked and does not use a worker with a time limit may be affected. This issue is patched in version 4.0.10. As a workaround, avoid running untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
7.5
Exponential catastrophic backtracking (ReDoS) in marked
Marked is a markdown parser and compiler. Prior to version 4.0.10, the regular expression inline.reflinkSearch may cause catastrophic backtracking against some strings and lead to a denial of service (DoS). Anyone who runs untrusted markdown through a vulnerable version of marked and does not use a worker with a time limit may be affected. This issue is patched in version 4.0.10. As a workaround, avoid running untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.
- Record
CVE-2022-21681- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-400, CWE-1333
- Updated
- 2026-11-02
EUVDEUVD-2022-0473
7.5
Marked is a markdown parser and compiler. Prior to version 4.0.10, the regular expression inline.reflinkSearch may cause catastrophic backtracking against some strings and lead to a denial of service (DoS). Anyone who runs untrusted markdown through a vulnerable version of marked and does not use a worker with a time limit may be affected. This issue is patched in version 4.0.10. As a workaround, avoid running untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.
- Record
EUVD-2022-0473- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-5v2h-r2cx-5xgj
7.5
Inefficient Regular Expression Complexity in marked
Impact
What kind of vulnerability is it?
Denial of service.
The regular expression inline.reflinkSearch may cause catastrophic backtracking against some strings.
PoC is the following.
import * as marked from 'marked';
console.log(marked.parse(`[x]: x
\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](`));
Who is impacted?
Anyone who runs untrusted markdown through marked and does not use a worker with a time limit.
Patches
Has the problem been patched?
Yes
What versions should users upgrade to?
4.0.10
Workarounds
Is there a way for users to fix or remediate the vulnerability without upgrading?
Do not run untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.
References
Are there any links users can visit to find out more?
- https://marked.js.org/using_advanced#workers
- 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
- Record
GHSA-5v2h-r2cx-5xgj- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1333
- Updated
- 2026-11-02
NVD
7.5
Marked is a markdown parser and compiler. Prior to version 4.0.10, the regular expression inline.reflinkSearch may cause catastrophic backtracking against some strings and lead to a denial of service (DoS). Anyone who runs untrusted markdown through a vulnerable version of marked and does not use a worker with a time limit may be affected. This issue is patched in version 4.0.10. As a workaround, avoid running untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.
- Record
CVE-2022-21681- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 2.0
- 5.0 Medium
AV:N/AC:L/Au:N/C:N/I:N/A:P - Weakness
- CWE-400, CWE-1333
- Updated
- 2026-11-02
OSV
7.5
Exponential catastrophic backtracking (ReDoS) in marked
Marked is a markdown parser and compiler. Prior to version 4.0.10, the regular expression inline.reflinkSearch may cause catastrophic backtracking against some strings and lead to a denial of service (DoS). Anyone who runs untrusted markdown through a vulnerable version of marked and does not use a worker with a time limit may be affected. This issue is patched in version 4.0.10. As a workaround, avoid running untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.
- Record
CVE-2022-21681- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1333, CWE-400
- Updated
- 2026-11-02
OSVGHSA-5v2h-r2cx-5xgj
7.5
Inefficient Regular Expression Complexity in marked
Impact
What kind of vulnerability is it?
Denial of service.
The regular expression inline.reflinkSearch may cause catastrophic backtracking against some strings.
PoC is the following.
import * as marked from 'marked';
console.log(marked.parse(`[x]: x
\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](`));
Who is impacted?
Anyone who runs untrusted markdown through marked and does not use a worker with a time limit.
Patches
Has the problem been patched?
Yes
What versions should users upgrade to?
4.0.10
Workarounds
Is there a way for users to fix or remediate the vulnerability without upgrading?
Do not run untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.
References
Are there any links users can visit to find out more?
- https://marked.js.org/using_advanced#workers
- 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
- Record
GHSA-5v2h-r2cx-5xgj- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-1333
- Updated
- 2026-11-02
Show 13 moreShow less
OSVUBUNTU-CVE-2022-21681
7.5
Marked is a markdown parser and compiler. Prior to version 4.0.10, the regular expression inline.reflinkSearch may cause catastrophic backtracking against some strings and lead to a denial of service (DoS). Anyone who runs untrusted markdown through a vulnerable version of marked and does not use a worker with a time limit may be affected. This issue is patched in version 4.0.10. As a workaround, avoid running untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.
- Record
UBUNTU-CVE-2022-21681- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVCLSA-2026-1770941372 No score
TuxCare security update for marked (2 CVEs)
TuxCare rebuilt marked to address 2 CVEs. Fixed in 4.0.7-tuxcare.1.
- Record
CLSA-2026-1770941372- Updated
- 2026-11-02
OSVCLSA-2026-1771200578 No score
TuxCare security update for marked (2 CVEs)
TuxCare rebuilt marked to address 2 CVEs. Fixed in 4.0.9-tuxcare.1.
- Record
CLSA-2026-1771200578- Updated
- 2026-11-02
OSVCLSA-2026-1771978225 No score
TuxCare security update for marked (2 CVEs)
TuxCare rebuilt marked to address 2 CVEs. Fixed in 0.7.0-tuxcare.1.
- Record
CLSA-2026-1771978225- Updated
- 2026-11-02
OSVCLSA-2026-1773188128 No score
TuxCare security update for marked (8 CVEs)
TuxCare rebuilt marked to address 8 CVEs. Fixed in 0.2.10-tuxcare.1.
- Record
CLSA-2026-1773188128- Updated
- 2026-11-02
OSVCLSA-2026-1784769549 No score
TuxCare security update for marked (2 CVEs)
TuxCare rebuilt marked to address 2 CVEs. Fixed in 0.8.2-tuxcare.1.
- Record
CLSA-2026-1784769549- Updated
- 2026-11-02
OSVCLSA-2026-1784769550 No score
TuxCare security update for marked (3 CVEs)
TuxCare rebuilt marked to address 3 CVEs. Fixed in 1.2.7-tuxcare.1.
- Record
CLSA-2026-1784769550- Updated
- 2026-11-02
OSVCLSA-2026-1790807470 No score
TuxCare security update for marked (2 CVEs)
TuxCare rebuilt marked to address 2 CVEs. Fixed in 2.1.3-tuxcare.1.
- Record
CLSA-2026-1790807470- Updated
- 2026-11-02
OSVCLSA-2026-1791584939 No score
TuxCare security update for marked (1 CVE)
TuxCare rebuilt marked to address 1 CVE. Fixed in 4.0.8-tuxcare.3.
- Record
CLSA-2026-1791584939- Updated
- 2026-11-02
OSVCLSA-2026-1793867531 No score
TuxCare security update for marked (2 CVEs)
TuxCare rebuilt marked to address 2 CVEs. Fixed in 0.3.19-tuxcare.3.
- Record
CLSA-2026-1793867531- Updated
- 2026-11-05
OSVCLSA-2026-1793885919 No score
TuxCare security update for marked (1 CVE)
TuxCare rebuilt marked to address 1 CVE. Fixed in 2.0.1-tuxcare.2.
- Record
CLSA-2026-1793885919- Updated
- 2026-11-06
OSVDEBIAN-CVE-2022-21681 No score
Marked is a markdown parser and compiler. Prior to version 4.0.10, the regular expression inline.reflinkSearch may cause catastrophic backtracking against some strings and lead to a denial of service (DoS). Anyone who runs untrusted markdown through a vulnerable version of marked and does not use a worker with a time limit may be affected. This issue is patched in version 4.0.10. As a workaround, avoid running untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.
- Record
DEBIAN-CVE-2022-21681- Updated
- 2026-11-03
OSVROOT-APP-NPM-CVE-2022-21681 No score
CVE-2022-21681 in marked - Patched by Root
Root has patched CVE-2022-21681 in the marked package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2022-21681- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
markednpm |
before 4.0.10 | 4.0.10 |
markedTuxCare:npm From an advisory covering 2 CVEs |
4.0.7-tuxcare.0 up to 4.0.7-tuxcare.1, plus listed versions 4.0.7 |
4.0.7-tuxcare.1 |
markedTuxCare:npm From an advisory covering 2 CVEs |
4.0.9-tuxcare.0 up to 4.0.9-tuxcare.1, plus listed versions 4.0.9 |
4.0.9-tuxcare.1 |
markedTuxCare:npm From an advisory covering 2 CVEs |
0.7.0-tuxcare.0 up to 0.7.0-tuxcare.1, plus listed versions 0.7.0 |
0.7.0-tuxcare.1 |
markedTuxCare:npm From an advisory covering 8 CVEs |
0.2.10-tuxcare.0 up to 0.2.10-tuxcare.1, plus listed versions 0.2.10 |
0.2.10-tuxcare.1 |
markedTuxCare:npm From an advisory covering 2 CVEs |
0.8.2-tuxcare.0 up to 0.8.2-tuxcare.1, plus listed versions 0.8.2 |
0.8.2-tuxcare.1 |
markedTuxCare:npm From an advisory covering 3 CVEs |
1.2.7-tuxcare.0 up to 1.2.7-tuxcare.1, plus listed versions 1.2.7 |
1.2.7-tuxcare.1 |
markedTuxCare:npm From an advisory covering 2 CVEs |
2.1.3-tuxcare.0 up to 2.1.3-tuxcare.1, plus listed versions 2.1.3 |
2.1.3-tuxcare.1 |
markedTuxCare:npm |
4.0.8-tuxcare.0 up to 4.0.8-tuxcare.3, plus listed versions 4.0.84.0.8-tuxcare.14.0.8-tuxcare.2 |
4.0.8-tuxcare.3 |
markedTuxCare:npm From an advisory covering 2 CVEs |
0.3.19-tuxcare.0 up to 0.3.19-tuxcare.3, plus listed versions 0.3.190.3.19-tuxcare.10.3.19-tuxcare.2 |
0.3.19-tuxcare.3 |
Show 14 moreShow less
| Package | Affected | Fixed |
|---|---|---|
markedTuxCare:npm |
2.0.1-tuxcare.0 up to 2.0.1-tuxcare.2, plus listed versions 2.0.12.0.1-tuxcare.1 |
2.0.1-tuxcare.2 |
node-markedDebian:12 |
before 4.0.12+ds+~4.0.1-1 | 4.0.12+ds+~4.0.1-1 |
node-markedDebian:13 |
before 4.0.12+ds+~4.0.1-1 | 4.0.12+ds+~4.0.1-1 |
node-markedDebian:14 |
before 4.0.12+ds+~4.0.1-1 | 4.0.12+ds+~4.0.1-1 |
markedRoot:npm |
before 4.0.9-aikido.1 | 4.0.9-aikido.10.3.19-aikido.10.3.19-aikido.2 |
@rootio/markedRoot:npm |
before 4.0.9-root.io.1 | 4.0.9-root.io.10.3.19-root.io.10.3.19-root.io.2 |
node-markedUbuntu:16.04:LTS |
All versions, plus listed versions 0.3.2+dfsg-1 |
None known |
node-markedUbuntu:18.04:LTS |
All versions, plus listed versions 0.3.6+dfsg-10.3.9+dfsg-1 |
None known |
node-markedUbuntu:20.04:LTS |
All versions, plus listed versions 0.5.1+dfsg-1 |
None known |
node-markedUbuntu:22.04:LTS |
All versions, plus listed versions 0.8.0+ds+repack-20.8.0+ds+repack-34.0.5+ds-54.0.9+ds+~4.0.1-24.0.12+ds+~4.0.1-14.0.12+ds+~4.0.1-2ubuntu14.0.12+ds+~4.0.1-2ubuntu2 |
None known |
node-markedUbuntu:24.04:LTS |
All versions, plus listed versions 4.2.3+ds+~4.0.7-2ubuntu14.2.3+ds+~4.0.7-3 |
None known |
node-markedUbuntu:25.10 |
All versions, plus listed versions 4.2.3+ds+~4.0.7-34.2.3+ds+~4.0.7-4 |
None known |
node-markedUbuntu:26.10 |
All versions, plus listed versions 4.2.3+ds+~4.0.7-44.3.0+ds1+~cs10.2.23-118.0.5+~cs7.2.17-218.0.6+~cs7.2.17-118.0.6+~cs7.2.17-2 |
None known |
node-markedUbuntu:26.04:LTS |
All versions, plus listed versions 4.2.3+ds+~4.0.7-4 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, aliases | OSV | |
| affected | ||
| affected, aliases, facts, published, references | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2022-21681 is a high vulnerability (CVSS 7.5) in Marked Project Marked, published January 14, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.89%, the 86th percentile. Fixed in marked 4.0.10.
References
github.com/markedjs/marked/security/advisories/GHSA-5v2h-r2cx-5xgj
github.com/markedjs/marked/commit/8f806573a3f6c6b7a39b8cdb66ab5ebb8d55a5f5
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AIXDMC3CSHYW3YWVSQOXAWLUYQHAO5UX
nvd.nist.gov/vuln/detail/CVE-2022-21681
lists.fedoraproject.org/archives/list/[email protected]/message/AIXDMC3CSHYW3YWVSQOXAWLUYQHAO5UX
github.com/markedjs/marked/commit/c4a3ccd344b6929afa8a1d50ac54a721e57012c0