CVE-2024-21539: @eslint/plugin kit Denial of Service Vulnerability

LOW
Advisory Identifier: GHSA-7q7g-4xm8-89cq
CVSS 3.5
CWE-1333 CWE-770
Published
Advisory Summary

CVE-2024-21539 is a LOW (CVSS 3.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting @eslint/plugin kit libraries in the npm ecosystem. The issue involves regular expression denial of service (redos) in @eslint/plugin-kit. Remediation is available by upgrading affected packages to version 0.2.3.

CVE-2024-21539 at a Glance

CVE Identifier CVE-2024-21539
GHSA Identifier GHSA-7q7g-4xm8-89cq
Severity LOW
CVSS v3.1 Base Score 3.5
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product @eslint/plugin kit
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 3.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2024-21539

To remediate this vulnerability, upgrade all affected @eslint/plugin kit dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@eslint/plugin-kit fixed: 0.2.3
npm install @eslint/plugin-kit@0.2.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @eslint/plugin-kit

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2024-21539, inspect your project dependencies using npm:

npm ls @eslint/plugin-kit

Analyze the terminal output to locate any version of @eslint/plugin kit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.3), your application is affected.

Note: The npm ls @eslint/plugin-kit command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In @eslint/plugin kit, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Crafting a very large and well crafted string can increase the CPU usage and crash the program. ## POC ```js 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 ```

CVE-2024-21539 Affected @eslint/plugin kit Versions

1 component(s)
Fixed Versions:
0.2.3
Product / Package Ecosystem Affected Versions Fixed Version
@eslint/plugin-kit
npm
< 0.2.3
0.2.3

References

Frequently Asked Questions

What is CVE-2024-21539?
CVE-2024-21539 is a security vulnerability in @eslint/plugin kit involving Regular Expression Denial of Service (ReDoS) in @eslint/plugin-kit under CWE-1333: Inefficient Regular Expression Complexity.
Which @eslint/plugin kit versions are affected?
Affected versions include releases prior to 0.2.3 across affected packages: @eslint/plugin-kit.
What version fixes CVE-2024-21539?
Upgrading to 0.2.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @eslint/plugin-kit affected?
Yes, @eslint/plugin-kit is affected in releases prior to 0.2.3. Upgrade your dependency to 0.2.3 or later.
What is the CVSS score of CVE-2024-21539?
CVE-2024-21539 has a CVSS v3.1 base score of 3.5 (LOW) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2024-21539?
CVE-2024-21539 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check npm dependencies for CVE-2024-21539?
Run the dependency tree command: 'npm ls @eslint/plugin-kit'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7q7g-4xm8-89cq",
  "modified" : "2024-11-19T20:49:57Z",
  "published" : "2024-11-15T20:47:31Z",
  "aliases" : [ "CVE-2024-21539" ],
  "summary" : "Regular Expression Denial of Service (ReDoS) in @eslint/plugin-kit",
  "details" : "Crafting a very large and well crafted string can increase the CPU usage and crash the program.\n\n## POC\n\n```js\nconst { ConfigCommentParser } = require(\"@eslint/plugin-kit\");\n\nvar str = \"\";\nfor (var i = 0; i < 1000000; i++) {\n  str += \" \";\n}\nstr += \"A\";\n\nconsole.log(\"start\")\nvar parser = new ConfigCommentParser();\nconsole.log(parser.parseStringConfig(str, \"\"));\nconsole.log(\"end\")\n\n// run `npm i @eslint/plugin-kit` and `node attack.js` \n// then the program will stuck forever with high CPU usage\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@eslint/plugin-kit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.2.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/eslint/rewrite/security/advisories/GHSA-7q7g-4xm8-89cq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-21539"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/eslint/rewrite/commit/071be842f0bd58de4863cdf2ab86d60f49912abf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/eslint/rewrite"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JS-ESLINTPLUGINKIT-8340627"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333", "CWE-770" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-15T20:47:31Z",
    "nvd_published_at" : "2024-11-19T05:15:16Z"
  }
}