CVE-2025-27789
Inefficient RexExp complexity in generated code with .replace when transpiling named capturing groups
Also known as GHSA-968p-4wvh-cqc8
Mitigation
- Upgrade @babel/helpers to one of 7.26.10, 8.0.0-alpha.17 (or later in the same release line).
- Upgrade @babel/runtime to one of 7.26.10, 8.0.0-alpha.17 (or later in the same release line).
- Upgrade @babel/runtime-corejs2 to one of 7.26.10, 8.0.0-alpha.17 (or later in the same release line).
- Upgrade @babel/runtime-corejs3 to one of 7.26.10, 8.0.0-alpha.17 (or later in the same release line).
Who should check
- Projects that depend on npm package @babel/helpers (< 7.26.10)
- Projects that depend on npm package @babel/runtime (< 7.26.10)
- Projects that depend on npm package @babel/runtime-corejs2 (< 7.26.10)
- Projects that depend on npm package @babel/runtime-corejs3 (< 7.26.10)
- Anyone running babel < 7.26.10; >= 8.0.0-alpha.0, < 8.0.0-alpha.17
Vulnerability facts
- Affected
- @babel/helpers < 7.26.10; @babel/runtime < 7.26.10; @babel/runtime-corejs2 < 7.26.10; @babel/runtime-corejs3 < 7.26.10
- Fixed in
- 7.26.10, 8.0.0-alpha.17
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 6.2 (v3.1, CNA)CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: None
- Integrity impact: None
- Availability impact: High
- EPSS
- 0.31% chance of exploitation in 30 days (percentile 16, 2026-11-26)
- CWE
- CWE-1333
- Modified
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| npm @babel/helpers | < 7.26.10 | 7.26.10, 8.0.0-alpha.17 | osv |
| npm @babel/runtime | < 7.26.10 | 7.26.10, 8.0.0-alpha.17 | osv |
| npm @babel/runtime-corejs2 | < 7.26.10 | 7.26.10, 8.0.0-alpha.17 | osv |
| npm @babel/runtime-corejs3 | < 7.26.10 | 7.26.10, 8.0.0-alpha.17 | osv |
| babel | < 7.26.10; >= 8.0.0-alpha.0, < 8.0.0-alpha.17 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2025-27789. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2025-27789.md Affected: @babel/helpers < 7.26.10; @babel/runtime < 7.26.10; @babel/runtime-corejs2 < 7.26.10; @babel/runtime-corejs3 < 7.26.10 Fixed in: 7.26.10, 8.0.0-alpha.17 Steps: 1. Search this machine and project for @babel/helpers (npm), @babel/runtime (npm), @babel/runtime-corejs2 (npm), @babel/runtime-corejs3 (npm), babel: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
FAQ
Is CVE-2025-27789 being exploited?
There is no confirmed exploitation: CVE-2025-27789 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.31% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2025-27789?
Medium: CVSS 6.2 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).
Which versions are affected by CVE-2025-27789?
@babel/helpers < 7.26.10; @babel/runtime < 7.26.10; @babel/runtime-corejs2 < 7.26.10; @babel/runtime-corejs3 < 7.26.10.
Is there a fix for CVE-2025-27789?
Yes. Fixed in 7.26.10, 8.0.0-alpha.17. Upgrade @babel/helpers to one of 7.26.10, 8.0.0-alpha.17 (or later in the same release line). Upgrade @babel/runtime to one of 7.26.10, 8.0.0-alpha.17 (or later in the same release line). Upgrade @babel/runtime-corejs2 to one of 7.26.10, 8.0.0-alpha.17 (or later in the same release line). Upgrade @babel/runtime-corejs3 to one of 7.26.10, 8.0.0-alpha.17 (or later in the same release line).
How do I check if I'm affected by CVE-2025-27789?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.