CVE-2022-21670: Uncontrolled Resource Consumption in markdown-it

Published Jan 10, 2022
·
Updated

Impact

Special patterns with length > 50K chars can slow down parser significantly.

js const md = require('markdown-it')();

md.render(x ${' '.repeat(150000)} x \nx);

Patches

Upgrade to v12.3.2+

Workarounds

No.

References

Fix + test sample: https://github.com/markdown-it/markdown-it/commit/ffc49ab46b5b751cd2be0aabb146f2ef84986101

Other sources

markdown-it is a Markdown parser. Prior to version 1.3.2, special patterns with length greater than 50 thousand characterss could slow down the parser significantly. Users should upgrade to version 12.3.2 to receive a patch. There are no known workarounds aside from upgrading.

Affected Software

2 affected componentsFixes available
npm/markdown-it<12.3.2
12.3.2
Markdown-it Project Markdown-it<=12.3.1

Event History

Jan 10, 2022
CVE Published
via MITRE·08:40 PM
Data Sourced
via MITRE·08:40 PM
DescriptionSeverityWeakness
Jan 12, 2022
Advisory Published
10:20 PM

Frequently Asked Questions

1

What is the severity of CVE-2022-21670?

CVE-2022-21670 has a moderate severity level due to its potential to significantly slow down the parser with specific input patterns.

2

How do I fix CVE-2022-21670?

To fix CVE-2022-21670, upgrade to version 12.3.2 or later of the markdown-it package.

3

Which versions are affected by CVE-2022-21670?

Versions of markdown-it prior to 12.3.2 are affected by CVE-2022-21670.

4

Is there a workaround for CVE-2022-21670?

There is no known workaround for CVE-2022-21670; upgrading is the only solution.

5

What happens if I use input patterns longer than 50K chars in markdown-it with CVE-2022-21670?

Using input patterns longer than 50K characters can slow down the parser significantly, as highlighted by CVE-2022-21670.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203