NodeJS/marked/4.0.4
A markdown parser built for speed
https://www.npmjs.com/package/marked
MIT
2 Security Vulnerabilities
Inefficient Regular Expression Complexity in marked
- https://github.com/markedjs/marked/security/advisories/GHSA-5v2h-r2cx-5xgj
- https://nvd.nist.gov/vuln/detail/CVE-2022-21681
- https://github.com/markedjs/marked/commit/8f806573a3f6c6b7a39b8cdb66ab5ebb8d55a5f5
- https://github.com/advisories/GHSA-5v2h-r2cx-5xgj
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AIXDMC3CSHYW3YWVSQOXAWLUYQHAO5UX/
- https://github.com/markedjs/marked/commit/c4a3ccd344b6929afa8a1d50ac54a721e57012c0
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
Inefficient Regular Expression Complexity in marked
- https://github.com/markedjs/marked/security/advisories/GHSA-rrrm-qjm4-v8hf
- https://nvd.nist.gov/vuln/detail/CVE-2022-21680
- https://github.com/markedjs/marked/commit/c4a3ccd344b6929afa8a1d50ac54a721e57012c0
- https://github.com/markedjs/marked/releases/tag/v4.0.10
- https://github.com/advisories/GHSA-rrrm-qjm4-v8hf
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AIXDMC3CSHYW3YWVSQOXAWLUYQHAO5UX/
Impact
What kind of vulnerability is it?
Denial of service.
The regular expression block.def
may cause catastrophic backtracking against some strings.
PoC is the following.
import * as marked from "marked";
marked.parse(`[x]:${' '.repeat(1500)}x ${' '.repeat(1500)} 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
170 Other Versions
Version | License | Security | Released | |
---|---|---|---|---|
1.2.4 | MIT | 3 | 2020-11-15 - 02:05 | over 3 years |
1.2.3 | MIT | 3 | 2020-11-04 - 21:25 | over 3 years |
1.2.2 | MIT | 3 | 2020-10-21 - 14:58 | over 3 years |
1.2.1 | MIT | 3 | 2020-10-21 - 14:51 | over 3 years |
1.2.0 | MIT | 3 | 2020-09-28 - 05:09 | over 3 years |
1.1.2 | MIT | 3 | 2020-10-21 - 14:40 | over 3 years |
1.1.1 | MIT | 3 | 2020-07-14 - 01:54 | almost 4 years |
1.1.0 | MIT | 2 | 2020-05-16 - 21:45 | almost 4 years |
1.0.0 | MIT | 2 | 2020-04-21 - 01:07 | about 4 years |
0.8.2 | MIT | 2 | 2020-03-22 - 15:44 | about 4 years |
0.8.1 | MIT | 2 | 2020-03-18 - 21:44 | about 4 years |
0.8.0 | MIT | 2 | 2019-12-12 - 20:49 | over 4 years |
0.7.0 | MIT | 2 | 2019-07-06 - 04:13 | almost 5 years |
0.6.3 | MIT | 3 | 2019-06-30 - 02:11 | almost 5 years |
0.6.2 | MIT | 3 | 2019-04-05 - 14:32 | about 5 years |
0.6.1 | MIT | 4 | 2019-02-19 - 20:03 | about 5 years |
0.6.0 | MIT | 5 | 2019-01-01 - 00:49 | over 5 years |
0.5.2 | MIT | 5 | 2018-11-20 - 00:04 | over 5 years |
0.5.1 | MIT | 5 | 2018-09-26 - 01:51 | over 5 years |
0.5.0 | MIT | 5 | 2018-08-16 - 22:07 | over 5 years |
0.4.0 | MIT | 4 | 2018-05-21 - 13:05 | almost 6 years |
0.3.19 | MIT | 3 | 2018-03-26 - 02:59 | about 6 years |
0.3.18 | MIT | 3 | 2018-03-22 - 17:01 | about 6 years |
0.3.17 | MIT | 3 | 2018-02-27 - 13:07 | about 6 years |
0.3.16 | MIT | 3 | 2018-02-20 - 20:56 | about 6 years |
0.3.15 | MIT | 3 | 2018-02-19 - 04:26 | about 6 years |
0.3.14 | MIT | 3 | 2018-02-16 - 13:35 | about 6 years |
0.3.13 | MIT | 2 | 2018-02-16 - 13:33 | about 6 years |
0.3.12 | MIT | 2 | 2018-01-09 - 00:10 | over 6 years |
0.3.9 | MIT | 2 | 2017-12-23 - 18:05 | over 6 years |
0.3.7 | MIT | 6 | 2017-12-01 - 18:08 | over 6 years |
0.3.6 | MIT | 7 | 2016-07-30 - 03:10 | almost 8 years |
0.3.5 | MIT | 9 | 2015-07-31 - 09:41 | almost 9 years |
0.3.4 | MIT | 9 | 2015-07-29 - 10:18 | almost 9 years |
0.3.3 | MIT | 11 | 2015-01-25 - 23:54 | over 9 years |
0.3.2 | MIT | 14 | 2014-03-10 - 07:25 | about 10 years |
0.3.1 | MIT | 14 | 2014-01-31 - 23:07 | over 10 years |
0.3.0 | MIT | 16 | 2013-12-24 - 14:14 | over 10 years |
0.2.10 | MIT | 16 | 2013-11-02 - 23:12 | over 10 years |
0.2.9 | MIT | 16 | 2013-05-29 - 01:43 | almost 11 years |
0.2.8 | MIT | 16 | 2013-02-02 - 02:40 | over 11 years |
0.2.7 | MIT | 16 | 2013-01-05 - 13:28 | over 11 years |
0.2.6 | MIT | 16 | 2012-11-23 - 16:09 | over 11 years |
0.2.5 | MIT | 16 | 2012-05-11 - 17:33 | almost 12 years |
0.2.4 | MIT | 16 | 2012-04-12 - 07:31 | about 12 years |
0.2.4-1 | MIT | 16 | 2012-04-21 - 21:46 | about 12 years |
0.2.3 | MIT | 16 | 2012-03-11 - 07:46 | about 12 years |
0.2.2 | MIT | 16 | 2012-03-10 - 22:38 | about 12 years |
0.2.2-1 | MIT | 16 | 2012-03-10 - 22:44 | about 12 years |
0.2.1 | MIT | 16 | 2012-02-20 - 15:20 | about 12 years |
0.2.0 | MIT | 16 | 2012-02-16 - 19:56 | about 12 years |
0.1.9 | MIT | 16 | 2012-01-30 - 18:19 | over 12 years |
0.1.8 | MIT | 16 | 2012-01-25 - 21:00 | over 12 years |
0.1.7 | MIT | 16 | 2012-01-21 - 15:35 | over 12 years |
0.1.6 | MIT | 16 | 2012-01-15 - 13:17 | over 12 years |
0.1.5 | MIT | 16 | 2012-01-04 - 08:12 | over 12 years |
0.1.4 | MIT | 16 | 2011-12-05 - 04:08 | over 12 years |
0.1.3 | MIT | 16 | 2011-11-27 - 04:16 | over 12 years |
0.1.2 | MIT | 16 | 2011-10-23 - 05:12 | over 12 years |
0.1.1 | MIT | 16 | 2011-10-14 - 23:34 | over 12 years |
0.1.0 | MIT | 16 | 2011-09-15 - 22:03 | over 12 years |
0.0.9 | MIT | 16 | 2011-08-27 - 23:49 | over 12 years |
0.0.8 | MIT | 16 | 2011-08-26 - 10:30 | over 12 years |
0.0.7 | MIT | 16 | 2011-08-25 - 16:48 | over 12 years |
0.0.6 | MIT | 16 | 2011-08-23 - 16:59 | over 12 years |
0.0.5 | MIT | 16 | 2011-08-19 - 00:54 | over 12 years |
0.0.4 | MIT | 16 | 2011-08-18 - 22:27 | over 12 years |
0.0.3 | MIT | 16 | 2011-08-14 - 05:09 | over 12 years |
0.0.2 | MIT | 16 | 2011-08-14 - 05:05 | over 12 years |
0.0.1 | MIT | 16 | 2011-07-24 - 13:15 | almost 13 years |