CVE-2025-27789Inefficient RexExp complexity in generated code with .replace when transpiling named…
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.
What to do
Fixed builds are available from npm: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | node-babel7 | Fix pending | UBUNTU-CVE-2025-27789 | |
| Ubuntu 26.04 | node-babel7 | Under investigation | UBUNTU-CVE-2025-27789 | |
| Ubuntu 25.10 | node-babel7 | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2025-27789 | |
| Ubuntu 24.04 | node-babel7 | Under investigation | UBUNTU-CVE-2025-27789 | |
| Ubuntu 22.04 | node-babel7 | Under investigation | UBUNTU-CVE-2025-27789 | |
| Ubuntu 20.04 | node-babel | Fix pending | UBUNTU-CVE-2025-27789 | |
| Ubuntu 18.04 | node-babel | Fix pending | UBUNTU-CVE-2025-27789 | |
| npm library | @babel/helpers | Fixed | 8.0.0-alpha.17 | GHSA-968p-4wvh-cqc8 |
| npm library | @babel/runtime | Fixed | 8.0.0-alpha.17 | GHSA-968p-4wvh-cqc8 |
| npm library | @babel/runtime-corejs2 | Fixed | 7.26.10 | GHSA-968p-4wvh-cqc8 |
| npm library | @babel/runtime-corejs3 | Fixed | 7.26.10 | GHSA-968p-4wvh-cqc8 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- babel: affected: < 7.26.10, >= 8.0.0-alpha.0, < 8.0.0-alpha.17
References
- https://github.com/babel/babel/security/advisories/GHSA-968p-4wvh-cqc8
- https://github.com/babel/babel/pull/17173
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.