CVE-2024-9506: Vue Denial of Service Vulnerability

LOW
Advisory Identifier: GHSA-5j4c-8p2g-v4jx
CVSS 3.7
CWE-1333
Published
Advisory Summary

CVE-2024-9506 is a LOW (CVSS 3.7) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Vue libraries in the npm ecosystem. The issue involves redos vulnerability in vue package that is exploitable through inefficient regex evaluation in the parsehtml function. Remediation is available by upgrading affected packages to version 3.0.0-alpha.0.

CVE-2024-9506 at a Glance

CVE Identifier CVE-2024-9506
GHSA Identifier GHSA-5j4c-8p2g-v4jx
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Vue
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 3.7

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

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

How to Fix CVE-2024-9506

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

vue fixed: 3.0.0-alpha.0
npm install vue@3.0.0-alpha.0
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 vue

How to Check if You Are Affected

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

npm ls vue

Analyze the terminal output to locate any version of Vue in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.0-alpha.0), your application is affected.

Note: The npm ls vue 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 Vue, 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

The ReDoS can be exploited through the `parseHTML` function in the `html-parser.ts` file. This flaw allows attackers to slow down the application by providing specially crafted input that causes inefficient processing of regular expressions, leading to excessive resource consumption. To demonstrate this vulnerability, here's an example. In a Vue client-side application, create a new Vue instance with a template string that includes a `<script>` tag but closes it incorrectly with something like `</textarea>`. ```javascript new Vue({ el: '#app', template: ' <div> Hello, world! <script>${'<'.repeat(1000000)}</textarea> </div>' }); ``` Next, set up a basic HTML page (e.g., index.html) to load this JavaScript and mount the Vue instance: ```html <!DOCTYPE html> <html> <head> <title>My first Vue app</title> </head> <body> <div id=\"app\">Loading...</div> </body> </html> ``` When you visit the app in your browser at http://localhost:3000, you'll notice that the time taken to parse and mount the Vue application increases significantly due to the ReDoS vulnerability, demonstrating how the flaw can affect performance.

CVE-2024-9506 Affected Vue Versions

1 component(s)
Fixed Versions:
3.0.0-alpha.0
Product / Package Ecosystem Affected Versions Fixed Version
vue
npm
≥ 2.0.0-alpha.1
< 3.0.0-alpha.0
3.0.0-alpha.0

References

Frequently Asked Questions

What is CVE-2024-9506?
CVE-2024-9506 is a security vulnerability in Vue involving ReDoS vulnerability in vue package that is exploitable through inefficient regex evaluation in the parseHTML function under CWE-1333: Inefficient Regular Expression Complexity.
Which Vue versions are affected?
Affected versions include releases prior to 3.0.0-alpha.0 across affected packages: vue.
What version fixes CVE-2024-9506?
Upgrading to 3.0.0-alpha.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is vue affected?
Yes, vue is affected in releases prior to 3.0.0-alpha.0. Upgrade your dependency to 3.0.0-alpha.0 or later.
What is the CVSS score of CVE-2024-9506?
CVE-2024-9506 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2024-9506?
CVE-2024-9506 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-9506?
Run the dependency tree command: 'npm ls vue'. 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-5j4c-8p2g-v4jx",
  "modified" : "2024-10-24T18:42:59Z",
  "published" : "2024-10-15T18:30:50Z",
  "aliases" : [ "CVE-2024-9506" ],
  "summary" : "ReDoS vulnerability in vue package that is exploitable through inefficient regex evaluation in the parseHTML function",
  "details" : "The ReDoS can be exploited through the `parseHTML` function in the `html-parser.ts` file. This flaw allows attackers to slow down the application by providing specially crafted input that causes inefficient processing of regular expressions, leading to excessive resource consumption.\n\nTo demonstrate this vulnerability, here's an example. In a Vue client-side application, create a new Vue instance with a template string that includes a `<script>` tag but closes it incorrectly with something like `</textarea>`.\n\n```javascript\nnew Vue({\n  el: '#app',\n  template: '\n    <div>\n      Hello, world!\n      <script>${'<'.repeat(1000000)}</textarea>\n    </div>'\n});\n```\nNext, set up a basic HTML page (e.g., index.html) to load this JavaScript and mount the Vue instance:\n\n```html\n<!DOCTYPE html>\n<html>\n<head>\n  <title>My first Vue app</title>\n</head>\n<body>\n  <div id=\\\"app\\\">Loading...</div>\n</body>\n</html>\n```\n\nWhen you visit the app in your browser at http://localhost:3000, you'll notice that the time taken to parse and mount the Vue application increases significantly due to the ReDoS vulnerability, demonstrating how the flaw can affect performance.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "vue"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0-alpha.1"
      }, {
        "fixed" : "3.0.0-alpha.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-9506"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vuejs/core"
  }, {
    "type" : "WEB",
    "url" : "https://www.herodevs.com/vulnerability-directory/cve-2024-9506"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-24T18:42:59Z",
    "nvd_published_at" : "2024-10-15T16:15:06Z"
  }
}