{"id":"CVE-2025-27789","published":"2025-03-11T19:09:28Z","modified":"2025-03-11T19:53:42Z","title":"Inefficient RexExp complexity in generated code with .replace when transpiling named capturing groups","vendor":"babel","product":"babel","tier":"tail","description":{"text":"Babel is a compiler for writing next generation JavaScript. When using versions of Babel prior to 7.26.10 and 8.0.0-alpha.17 to compile regular expression named capturing groups, Babel will generate a polyfill for the `.replace` method that has quadratic complexity on some specific replacement pattern strings (i.e. the second argument passed to `.replace`). Generated code is vulnerable if all the following conditions are true: Using Babel to compile regular expression named capturing groups, using the `.replace` method on a regular expression that contains named capturing groups, and the code using untrusted strings as the second argument of `.replace`. This problem has been fixed in `@babel/helpers` and `@babel/runtime` 7.26.10 and 8.0.0-alpha.17. It's likely that individual users do not directly depend on `@babel/helpers`, and instead depend on `@babel/core` (which itself depends on `@babel/helpers`). Upgrading to `@babel/core` 7.26.10 is not required, but it guarantees use of a new enough `@babel/helpers` version. Note that just updating Babel dependencies is not enough; one will also need to re-compile the code. No known workarounds are available.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.2,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00308,"percentile":0.16153,"provenance":"source"},"cwes":[{"id":"CWE-1333","name":"Inefficient Regular Expression Complexity"}],"references":[{"url":"https://github.com/babel/babel/security/advisories/GHSA-968p-4wvh-cqc8","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/babel/babel/pull/17173","tags":["x_refsource_MISC"]}],"priority":{"score":7.6,"factors":[{"name":"EPSS percentile","points":3.23},{"name":"CVSS severity","points":4.34}]},"vendorSlug":"babel","affectedVersions":[{"vendor":"babel","product":"babel","versions":["< 7.26.10",">= 8.0.0-alpha.0, < 8.0.0-alpha.17"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-03-11T19:53:22.902147Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"@babel/helpers","vulnerableRanges":["<7.26.10",">=8.0.0-alpha.0, <8.0.0-alpha.17"],"patched":["7.26.10","8.0.0-alpha.17"],"from":["GHSA-968p-4wvh-cqc8"],"provenance":"source"},{"ecosystem":"npm","package":"@babel/runtime","vulnerableRanges":["<7.26.10",">=8.0.0-alpha.0, <8.0.0-alpha.17"],"patched":["7.26.10","8.0.0-alpha.17"],"from":["GHSA-968p-4wvh-cqc8"],"provenance":"source"},{"ecosystem":"npm","package":"@babel/runtime-corejs2","vulnerableRanges":["<7.26.10",">=8.0.0-alpha.0, <8.0.0-alpha.17"],"patched":["7.26.10","8.0.0-alpha.17"],"from":["GHSA-968p-4wvh-cqc8"],"provenance":"source"},{"ecosystem":"npm","package":"@babel/runtime-corejs3","vulnerableRanges":["<7.26.10",">=8.0.0-alpha.0, <8.0.0-alpha.17"],"patched":["7.26.10","8.0.0-alpha.17"],"from":["GHSA-968p-4wvh-cqc8"],"provenance":"source"}],"euvd":{"id":"EUVD-2025-7806","exploited":false,"provenance":"source"}}