GHSA-5j4c-8p2g-v4jx

Suggest an improvement
Source
https://github.com/advisories/GHSA-5j4c-8p2g-v4jx
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/10/GHSA-5j4c-8p2g-v4jx/GHSA-5j4c-8p2g-v4jx.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-5j4c-8p2g-v4jx
Aliases
  • CVE-2024-9506
Published
2024-10-15T18:30:50Z
Modified
2024-10-24T19:12:14.925352Z
Severity
  • 3.7 (Low) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L CVSS Calculator
  • 2.9 (Low) CVSS_V4 - 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 CVSS Calculator
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.

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>
  &lt;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.

Database specific
{
    "nvd_published_at": "2024-10-15T16:15:06Z",
    "cwe_ids": [
        "CWE-1333"
    ],
    "severity": "LOW",
    "github_reviewed": true,
    "github_reviewed_at": "2024-10-24T18:42:59Z"
}
References

Affected packages

npm / vue

Package

Affected ranges

Type
SEMVER
Events
Introduced
2.0.0-alpha.1
Fixed
3.0.0-alpha.0