Regular Expression Denial of Service (ReDoS)
cve-program · CVE-2024-9506
PublishedImproper regular expression in Vue's parseHTML function leads to a potential regular expression denial of service vulnerability.
Read the publisher's advisoryeuvd · EUVD-2024-2953
PublishedImproper regular expression in Vue's parseHTML function leads to a potential regular expression denial of service vulnerability.
Read the publisher's advisorynvd · CVE-2024-9506
PublishedImproper regular expression in Vue's parseHTML function leads to a potential regular expression denial of service vulnerability.
Read the publisher's advisoryosv · GHSA-5j4c-8p2g-v4jx
PublishedThe 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.
Read the publisher's advisoryAffected versions, risk and source history
Related advisories and sources
Publishers link these advisories through the identifiers shown below. A shared identifier or date alone does not tell you whether your software is affected or whether the advisories describe the same cause.
CVE-2024-9506 · CVE overview and exploitation status
cve-program · CVE-2024-9506
euvd · EUVD-2024-2953
nvd · CVE-2024-9506
osv · GHSA-5j4c-8p2g-v4jx
Related changes
Linked by CVE identifierNo related changes are available here.