Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. vue
  4. ›
  5. CVE-2024-9506

CVE-2024-9506: ReDoS vulnerability in vue package that is exploitable through inefficient regex evaluation in the parseHTML function

October 15, 2024 (updated October 24, 2024)

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>.

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:

<!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.

References

  • github.com/advisories/GHSA-5j4c-8p2g-v4jx
  • github.com/vuejs/core
  • nvd.nist.gov/vuln/detail/CVE-2024-9506
  • www.herodevs.com/vulnerability-directory/cve-2024-9506

Code Behaviors & Features

Detect and mitigate CVE-2024-9506 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 2.0.0-alpha.1 before 3.0.0-alpha.0

Fixed versions

  • 3.0.0-alpha.0

Solution

Upgrade to version 3.0.0-alpha.0 or above.

Impact 3.7 LOW

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L

Learn more about CVSS

Weakness

  • CWE-1333: Inefficient Regular Expression Complexity

Source file

npm/vue/CVE-2024-9506.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:52 +0000.