CVE-2025-27789: Babel - Denial of Service
- Cve: CVE-2025-27789
- Name: Babel - Denial of Service
- 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.
- Impact: Attackers can cause denial of service through quadratic complexity in `.replace`, leading to potential application slowdown or crash.
- Remediation: Upgrade `@babel/helpers` and `@babel/runtime` to 7.26.10 and 8.0.0-alpha.17 respectively, and re-compile your code.
- Vulnerability impact: denial_of_service
- Requirement type: user_interaction
- Requirements: Code must use untrusted strings as the second argument of `.replace` on regex with named capturing groups
- Labels source: projectdiscovery
- Severity: medium
- Cvss score: 6.2
- Cvss vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Epss score: 0.00563
- Epss percentile: 0.47468
- Assignee: [email protected]
- Published at: 2025-03-11T20:15:18Z
- Age in days: 623
- Modified at: 2026-06-17T09:04:13Z
- Patch available: yes
- References total: 2
- Products total: 1
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2025-27789
- Nvd status: deferred
- Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
- Not known: vulnerability type
Cwe
| Id | Name |
|---|---|
| CWE-1333 | Inefficient Regular Expression Complexity |
Hackerone
- Reports: 1
- Rank: 5211
References
| Url | Source | Tags |
|---|---|---|
| https://github.com/babel/babel/pull/17173 | nvd | |
| https://github.com/babel/babel/security/advisories/GHSA-968p-4wvh-cqc8 | nvd |
Products
| Product | Affected | Platform bound | Sources | Url |
|---|---|---|---|---|
| babel:babel | >= 8.0.0-alpha.0, < 8.0.0-alpha.17; < 7.26.10 | no | cna_alias_text | /v1/products/babel/babel |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| babel/babel | commit, package, pull, security_advisory | yes | /v1/repositories/babel/babel |
Index
- Repositories: 2481
- Repositories high signal: 1078
- Packages: 4
Exploitation
- Hackerone reports: 1
- Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access, remote, authentication required
- Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, exposed hosts