CyberSecBulletin
CVE-2023-45133NVD status: Modified

babel: Incorrect Comparison

CVE-2023-45133 is a high-severity incorrect comparison vulnerability in babel, with a CVSS 3.1 base score of 8.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. Affected babel versions: < 7.23.2; >= 8.0.0-alpha.0, < 8.0.0-alpha.4. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 0.53% chance of exploitation within 30 days, which is low compared with other CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Babel-helper-define-polyfill-provider to 0.4.3 or a later version.
  2. Update Babel-plugin-polyfill-corejs2 to 0.4.6 or a later version.
  3. Update Babel-plugin-polyfill-corejs3 to 0.8.5 or a later version.
  4. Read the advisory on github.com for workarounds and exact fixed builds.

Affected products and versions

VendorProductAffected versionsFixed in
Babelbabel< 7.23.2; >= 8.0.0-alpha.0, < 8.0.0-alpha.4Not stated
DebianDebian Linux10.0; 11.0; 12.0Not stated
BabeljsBabel-helper-define-polyfill-providerbefore 0.4.30.4.3
BabeljsBabel-plugin-polyfill-corejs2before 0.4.60.4.6
BabeljsBabel-plugin-polyfill-corejs3before 0.8.50.8.5
BabeljsBabel-plugin-polyfill-es-shimsbefore 0.10.00.10.0
BabeljsBabel-plugin-polyfill-regeneratorbefore 0.5.30.5.3
BabeljsBabel-plugin-transform-runtimebefore 7.23.27.23.2
BabeljsBabel-preset-envbefore 7.23.27.23.2

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
LocalThe attacker needs local access or must trick a user into running something.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
LowA basic user account is enough.
User interaction
NoneNo action by a victim is required.
Scope
ChangedThe attack can reach beyond the vulnerable component into other systems.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.19.3CriticalCNA (github.com)
CVSS 3.18.8HighNVD

Official description

Babel is a compiler for writingJavaScript. In `@babel/traverse` prior to versions 7.23.2 and 8.0.0-alpha.4 and all versions of `babel-traverse`, using Babel to compile code that was specifically crafted by an attacker can lead to arbitrary code execution during compilation, when using plugins that rely on the `path.evaluate()`or `path.evaluateTruthy()` internal Babel methods. Known affected plugins are `@babel/plugin-transform-runtime`; `@babel/preset-env` when using its `useBuiltIns` option; and any "polyfill provider" plugin that depends on `@babel/helper-define-polyfill-provider`, such as `babel-plugin-polyfill-corejs3`, `babel-plugin-polyfill-corejs2`, `babel-plugin-polyfill-es-shims`, `babel-plugin-polyfill-regenerator`. No other plugins under the `@babel/` namespace are impacted, but third-party plugins might be. Users that only compile trusted code are not impacted. The vulnerability has been fixed in `@babel/[email protected]` and `@babel/[email protected]`. Those who cannot upgrade `@babel/traverse` and are using one of the affected packages mentioned above should upgrade them to their latest version to avoid triggering the vulnerable code path in affected `@babel/traverse` versions: `@babel/plugin-transform-runtime` v7.23.2, `@babel/preset-env` v7.23.2, `@babel/helper-define-polyfill-provider` v0.4.3, `babel-plugin-polyfill-corejs2` v0.4.6, `babel-plugin-polyfill-corejs3` v0.8.5, `babel-plugin-polyfill-es-shims` v0.10.0, `babel-plugin-polyfill-regenerator` v0.5.3.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Incorrect Comparison

The product compares two entities in a security-relevant context, but the comparison is incorrect.

More Incorrect Comparison vulnerabilities (CWE-697)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
  3. Record last changed materially (score, affected products, status or references).

References

Third-party and government advisories

Other references

Other vulnerabilities in babel

All babel vulnerabilities

Recent Incorrect Comparison vulnerabilities

Spotted an error? Tell us.