CVE-2025-27789 Details
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.
A regular expression denial-of-service (ReDoS) vulnerability has been identified in Babel, a JavaScript compiler. This issue affects Babel versions prior to 7.26.10 and 8.0.0-alpha.17. The vulnerability arises when Babel compiles regular expression named capturing groups and generates a polyfill for the `.replace` method. This polyfill can introduce quadratic complexity, leading to high CPU usage and potential application freezing. The vulnerability is exploitable if untrusted strings are used as the second argument of the `.replace` method on regular expressions with named capturing groups.
Users should upgrade to Babel versions 7.26.10 or 8.0.0-alpha.17. After updating, it is essential to recompile the code to apply the changes.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Mar 11, 2025CISA-ADP
Assessed Mar 11, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/babel/babel/pull/17173 | [email protected] | ExploitIssue TrackingTechnical DescriptionVendor |
| https://github.com/babel/babel/security/advisories/GHSA-968p-4wvh-cqc8 | [email protected] | AdvisoryRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-1333 | Inefficient Regular Expression Complexity | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| Babel | All versions |
CPE
Remediation
| |
| @babel/helpers | All versions |
CPE
Remediation
| |
| @babel/runtime | All versions |
CPE
Remediation
| |
| @babel/runtime-corejs2 | All versions |
CPE
Remediation
| |
| @babel/runtime-corejs3 | All versions |
CPE
Remediation
| |
Change History
3 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Mar 11, 2025 | New CVE Received | [email protected] |
Volerion