GitHub Advisoryadvisory · npm

GHSA-5j4c-8p2g-v4jx ReDoS vulnerability in vue package that is exploitable through inefficient regex evaluation in the parseHTML function

LOW Published 2024-10-15 Modified 2024-10-24 Official page ↗
Aliases
CVE-2024-9506
Ecosystem
npm
Packages
vue
Severity
Low
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
Weaknesses
CWE-1333
Reviewed
2024-10-24

Affected packages

• npm vue: >= 2.0.0-alpha.1, < 3.0.0-alpha.0 → fixed in 3.0.0-alpha.0

Description

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 `` tag but closes it incorrectly with something like ``. ```javascript new Vue({ el: '#app', template: ' Hello, world! ${' ' }); ``` Next, set up a basic HTML page (e.g., index.html) to load this JavaScript and mount the Vue instance: ```html My first Vue app Loading... ``` 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.

Related

Alias · CVE (1)

  • CVE-2024-9506 Improper regular expression in Vue's parseHTML function leads to a potential regular expression denial of service vulnerability. vulnerability

Weakness · CWE (1)

  • CWE-1333 Inefficient Regular Expression Complexity weakness

References