Cloudanix VulnDB

CVE-2025-27789

Medium · 6.2

CVSS

6.2

EPSS

0.6%

Published

Mar 11, 2025

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A JavaScript conversion tool can accidentally produce slow code that lets attackers slow down or crash applications by feeding it certain text patterns.

Exploitation
Local Privilege
Attacker needs
None
Complexity
Low
Impact
Denial Of Service
Component
Library
Class
Denial of service
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Generates a .replace polyfill with quadratic time complexity when processing regular expressions containing named capturing groups and specific untrusted replacement pattern strings.

Why it matters to the business

Applications built with affected Babel versions can experience severe performance degradation or denial of service when processing untrusted input through compiled regex replace operations, potentially disrupting services and increasing compute costs.

How an attack unfolds

An attacker identifies code paths using Babel-compiled regular expressions with named capture groups, supplies a specially crafted replacement string as the second argument to .replace, and triggers repeated execution to exploit the quadratic complexity and exhaust CPU resources.

How to fix it

Upgrade @babel/helpers and @babel/runtime to 7.26.10 (or 8.0.0-alpha.17) or later; upgrading @babel/core to 7.26.10 ensures a compatible helpers version; after the dependency update, fully recompile all affected source code with the patched Babel.

How to confirm the fix worked

Inspect package.json and lockfiles for @babel/helpers/@babel/runtime versions at or above 7.26.10, confirm the generated output no longer contains the vulnerable polyfill, and test regex replace operations with known quadratic-triggering patterns under load.

Typical attack path

  1. Locate JavaScript code compiled by vulnerable Babel that uses named capturing groups in regex literals
  2. Identify call sites passing untrusted data as the replacement argument to .replace
  3. Craft a replacement string that triggers quadratic behavior in the generated polyfill
  4. Submit the input repeatedly or at high volume to induce resource exhaustion

How to detect it

Review application and web-server logs for unusually high CPU or long-running requests involving regex replace operations; correlate with source maps or build metadata to identify bundles produced by vulnerable Babel versions; inspect generated JavaScript for the presence of the quadratic polyfill pattern.

What your security team should do

  • Immediately update Babel helpers and runtime packages to the fixed releases
  • Rebuild and redeploy all transpiled bundles using the updated compiler
  • Review application code for regex replace operations on named-capture patterns and add input validation or rate limiting where feasible
  • Monitor CPU and request latency metrics for anomalies on services handling user-supplied strings in regex operations

The record

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 packages

Ecosystem Package Introduced Fixed
npm @babel/helpers 0 7.26.10
npm @babel/helpers 8.0.0-alpha.0 8.0.0-alpha.17
npm @babel/runtime 0 7.26.10
npm @babel/runtime 8.0.0-alpha.0 8.0.0-alpha.17
npm @babel/runtime-corejs2 0 7.26.10
npm @babel/runtime-corejs2 8.0.0-alpha.0 8.0.0-alpha.17
npm @babel/runtime-corejs3 0 7.26.10
npm @babel/runtime-corejs3 8.0.0-alpha.0 8.0.0-alpha.17
Chainguard argo-workflow-cli 0 3.6.5-r1
Chainguard argo-workflow-controller 0 3.6.5-r1
Chainguard argo-workflow-controller-compat 0 3.6.5-r1
Chainguard argo-workflow-executor 0 3.6.5-r1
Chainguard argo-workflow-executor-compat 0 3.6.5-r1
Chainguard argo-workflows 0 3.6.5-r1
Chainguard argo-workflows-known-hosts 0 3.6.5-r1
Chainguard argo-workflows-ui 0 3.6.5-r1
Chainguard jitsucom-jitsu 0 2.8.6-r3
Chainguard jitsucom-jitsu-console 0 2.8.6-r3
Chainguard jitsucom-jitsu-rotor 0 2.8.6-r3
Chainguard kibana-7 0 7.17.28-r2
Chainguard kibana-7-bitnami 0 7.17.28-r2
Chainguard kibana-8 0 8.17.3-r2
Chainguard kibana-8-bitnami 0 8.17.3-r2
Chainguard kibana-8-iamguarded 0 8.17.3-r2
Chainguard opensearch-dashboards-2 0 2.19.1-r1
Chainguard opensearch-dashboards-2-alerting-dashboards-plugin 0 2.19.1-r1
Chainguard opensearch-dashboards-2-anomaly-detection-dashboards-plugin 0 2.19.1-r1
Chainguard opensearch-dashboards-2-compat 0 2.19.1-r1
Chainguard opensearch-dashboards-2-config 0 2.19.1-r1
Chainguard opensearch-dashboards-2-dashboards-maps 0 2.19.1-r1
Chainguard opensearch-dashboards-2-dashboards-notifications 0 2.19.1-r1
Chainguard opensearch-dashboards-2-dashboards-observability 0 2.19.1-r1
Chainguard opensearch-dashboards-2-dashboards-query-workbench 0 2.19.1-r1
Chainguard opensearch-dashboards-2-dashboards-reporting 0 2.19.1-r1
Chainguard opensearch-dashboards-2-dashboards-search-relevance 0 2.19.1-r1
Chainguard opensearch-dashboards-2-dashboards-visualizations 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips-alerting-dashboards-plugin 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips-anomaly-detection-dashboards-plugin 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips-config 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips-dashboards-maps 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips-dashboards-notifications 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips-dashboards-observability 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips-dashboards-query-workbench 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips-dashboards-reporting 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips-dashboards-search-relevance 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips-dashboards-visualizations 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips-index-management-dashboards-plugin 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips-ml-commons-dashboards 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips-security-analytics-dashboards-plugin 0 2.19.1-r1
Chainguard opensearch-dashboards-2-fips-security-dashboards-plugin 0 2.19.1-r1
Chainguard opensearch-dashboards-2-index-management-dashboards-plugin 0 2.19.1-r1
Chainguard opensearch-dashboards-2-ml-commons-dashboards 0 2.19.1-r1
Chainguard opensearch-dashboards-2-security-analytics-dashboards-plugin 0 2.19.1-r1
Chainguard opensearch-dashboards-2-security-dashboards-plugin 0 2.19.1-r1
Chainguard prism 0 5.12.1-r4
Chainguard vitess-18.0 0 18.0.8-r8
Chainguard vitess-18.0-binaries 0 18.0.8-r8
Chainguard vitess-20.0 0 20.0.6-r4
Chainguard vitess-20.0-binaries 0 20.0.6-r4
Chainguard vitess-20.0-compat 0 20.0.6-r4
Chainguard vitess-21.0 0 21.0.3-r3
Chainguard vitess-21.0-binaries 0 21.0.3-r3
Chainguard vitess-21.0-compat 0 21.0.3-r3
Wolfi argo-workflow-cli 0 3.6.5-r1
Wolfi argo-workflow-controller 0 3.6.5-r1
Wolfi argo-workflow-controller-compat 0 3.6.5-r1
Wolfi argo-workflow-executor 0 3.6.5-r1
Wolfi argo-workflow-executor-compat 0 3.6.5-r1
Wolfi argo-workflows 0 3.6.5-r1
Wolfi argo-workflows-known-hosts 0 3.6.5-r1
Wolfi argo-workflows-ui 0 3.6.5-r1
Wolfi jitsucom-jitsu 0 2.8.6-r3
Wolfi jitsucom-jitsu-console 0 2.8.6-r3
Wolfi jitsucom-jitsu-rotor 0 2.8.6-r3
Wolfi opensearch-dashboards-2 0 2.19.1-r1
Wolfi opensearch-dashboards-2-alerting-dashboards-plugin 0 2.19.1-r1
Wolfi opensearch-dashboards-2-anomaly-detection-dashboards-plugin 0 2.19.1-r1
Wolfi opensearch-dashboards-2-compat 0 2.19.1-r1
Wolfi opensearch-dashboards-2-config 0 2.19.1-r1
Wolfi opensearch-dashboards-2-dashboards-maps 0 2.19.1-r1
Wolfi opensearch-dashboards-2-dashboards-notifications 0 2.19.1-r1
Wolfi opensearch-dashboards-2-dashboards-observability 0 2.19.1-r1
Wolfi opensearch-dashboards-2-dashboards-query-workbench 0 2.19.1-r1
Wolfi opensearch-dashboards-2-dashboards-reporting 0 2.19.1-r1
Wolfi opensearch-dashboards-2-dashboards-search-relevance 0 2.19.1-r1
Wolfi opensearch-dashboards-2-dashboards-visualizations 0 2.19.1-r1
Wolfi opensearch-dashboards-2-index-management-dashboards-plugin 0 2.19.1-r1
Wolfi opensearch-dashboards-2-ml-commons-dashboards 0 2.19.1-r1
Wolfi opensearch-dashboards-2-security-analytics-dashboards-plugin 0 2.19.1-r1
Wolfi opensearch-dashboards-2-security-dashboards-plugin 0 2.19.1-r1
Wolfi prism 0 5.12.1-r4
Wolfi vitess-20.0 0 20.0.6-r4
Wolfi vitess-20.0-binaries 0 20.0.6-r4
Wolfi vitess-20.0-compat 0 20.0.6-r4
Wolfi vitess-21.0 0 21.0.3-r3
Wolfi vitess-21.0-binaries 0 21.0.3-r3
Wolfi vitess-21.0-compat 0 21.0.3-r3

Related vulnerabilities