{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2025-27789","id":"CVE-2025-27789","title":"Inefficient RexExp complexity in generated code with .replace when transpiling named capturing groups","description":"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 ","descriptionLong":"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.","published":"2025-03-11T19:09:28.146Z","updated":"2026-10-28T02:30:25.954437332Z","reserved":"2025-03-06T18:06:54.462Z","status":"Deferred","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"GitHub_M"},"metrics":[{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"GitHub_M"},{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"github.com"},{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"OSV"},{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"GitHub"}],"rating":"medium","products":["babel"],"affectedProducts":[{"vendor":"babel","product":"babel","defaultStatus":null,"versions":[{"version":"< 7.26.10","status":"affected"},{"version":">= 8.0.0-alpha.0, < 8.0.0-alpha.17","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"npm","name":"@babel/helpers","purl":"pkg:npm/%40babel/helpers","ranges":["<7.26.10",">=8.0.0-alpha.0 <8.0.0-alpha.17"],"fixed":["7.26.10","8.0.0-alpha.17"],"advisory":"GHSA-968p-4wvh-cqc8"},{"ecosystem":"npm","name":"@babel/runtime","purl":"pkg:npm/%40babel/runtime","ranges":["<7.26.10",">=8.0.0-alpha.0 <8.0.0-alpha.17"],"fixed":["7.26.10","8.0.0-alpha.17"],"advisory":"GHSA-968p-4wvh-cqc8"},{"ecosystem":"npm","name":"@babel/runtime-corejs2","purl":"pkg:npm/%40babel/runtime-corejs2","ranges":["<7.26.10",">=8.0.0-alpha.0 <8.0.0-alpha.17"],"fixed":["7.26.10","8.0.0-alpha.17"],"advisory":"GHSA-968p-4wvh-cqc8"},{"ecosystem":"npm","name":"@babel/runtime-corejs3","purl":"pkg:npm/%40babel/runtime-corejs3","ranges":["<7.26.10",">=8.0.0-alpha.0 <8.0.0-alpha.17"],"fixed":["7.26.10","8.0.0-alpha.17"],"advisory":"GHSA-968p-4wvh-cqc8"}],"cwes":["CWE-1333"],"aliases":["GHSA-968p-4wvh-cqc8"],"references":[{"url":"https://github.com/babel/babel/security/advisories/GHSA-968p-4wvh-cqc8","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://github.com/babel/babel/pull/17173","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/27xxx/CVE-2025-27789.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-27789","tags":["advisory"]},{"url":"https://github.com/babel/babel/commit/d5952e80c0faa5ec20e35085531b6e572d31dad4","tags":["web"]},{"url":"https://github.com/babel/babel","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial"},"epss":0.00563,"epssPercentile":0.476,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2025-27789","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-27789","ok":true,"note":"Deferred"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2025-27789","ok":true,"note":"4 packages"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-968p-4wvh-cqc8","ok":true,"note":"GHSA-968p-4wvh-cqc8"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2025-27789","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}