# CVE-2025-27789: Inefficient RexExp complexity in generated code with .replace when transpiling named capturing groups

- Severity: Medium 6.2 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.56%, higher than 48% of CVEs (2026-12-01)
- Published: 2025-03-11T19:09:28.146Z
- Modified: 2026-09-10T03:50:22.971Z
- Also known as: GHSA-968p-4wvh-cqc8
- Weaknesses: CWE-1333
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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 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.

(As written by CVE List.)

## Affected

- babel babel: < 7.26.10; >= 8.0.0-alpha.0, < 8.0.0-alpha.17
- @babel/helpers (npm): before 7.26.10; from 8.0.0-alpha.0 before 8.0.0-alpha.17
- @babel/runtime (npm): before 7.26.10; from 8.0.0-alpha.0 before 8.0.0-alpha.17
- @babel/runtime-corejs2 (npm): before 7.26.10; from 8.0.0-alpha.0 before 8.0.0-alpha.17
- @babel/runtime-corejs3 (npm): before 7.26.10; from 8.0.0-alpha.0 before 8.0.0-alpha.17

## Every score

- GitHub_M: CVSS:3.1 6.2 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 6.2 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://github.com/babel/babel/security/advisories/GHSA-968p-4wvh-cqc8> (web)
- <https://github.com/babel/babel/pull/17173> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-27789> (advisory)
- <https://github.com/babel/babel/commit/d5952e80c0faa5ec20e35085531b6e572d31dad4> (web)
- <https://github.com/babel/babel> (package)

## Sources

- CVE List: [CVE-2025-27789](https://www.cve.org/CVERecord?id=CVE-2025-27789), CVE Terms of Use, modified 2025-03-11
- GitHub Advisory Database: [GHSA-968p-4wvh-cqc8](https://github.com/advisories/GHSA-968p-4wvh-cqc8), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2025-27789](https://nvd.nist.gov/vuln/detail/CVE-2025-27789), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-27789 · Whole record: https://cve.day/CVE-2025-27789.json · Rebuilt by cve.day 2026-11-25T22:58:55.164Z
