CVEfocus › CVE database › CVE-2025-27789

CVE-2025-27789Inefficient RexExp complexity in generated code with .replace when transpiling named…

CVSS 6.2 MediumEPSS 0.3% (higher than 16% of CVEs)Published 2025-03-11Updated 2025-03-11Assigner: GitHub_M

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.

CWE-1333

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

4Fixed
3Fix pending
3Under investigation
1Will not fix

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10node-babel7Fix pendingUBUNTU-CVE-2025-27789
Ubuntu 26.04node-babel7Under investigationUBUNTU-CVE-2025-27789
Ubuntu 25.10node-babel7Will not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2025-27789
Ubuntu 24.04node-babel7Under investigationUBUNTU-CVE-2025-27789
Ubuntu 22.04node-babel7Under investigationUBUNTU-CVE-2025-27789
Ubuntu 20.04node-babelFix pendingUBUNTU-CVE-2025-27789
Ubuntu 18.04node-babelFix pendingUBUNTU-CVE-2025-27789
npm library@babel/helpersFixed8.0.0-alpha.17GHSA-968p-4wvh-cqc8
npm library@babel/runtimeFixed8.0.0-alpha.17GHSA-968p-4wvh-cqc8
npm library@babel/runtime-corejs2Fixed7.26.10GHSA-968p-4wvh-cqc8
npm library@babel/runtime-corejs3Fixed7.26.10GHSA-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.

References

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.