CVE-2023-45133 is a critical-severity (CVSS 9.3) CWE-184 vulnerability in @babel/traverse. A fix is available for @babel/traverse — see the affected versions and patch details below.
Babel vulnerable to arbitrary code execution when compiling specifically crafted malicious code
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2023-45133.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@babel/traversenpmbabel-traversenpmDescription
Impact
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-envwhen using itsuseBuiltInsoption- Any "polyfill provider" plugin that depends on
@babel/helper-define-polyfill-provider, such asbabel-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.
Patches
The vulnerability has been fixed in @babel/[email protected].
Babel 6 does not receive security fixes anymore (see Babel's security policy), hence there is no patch planned for babel-traverse@6.
Workarounds
- Upgrade
@babel/traverseto v7.23.2 or higher. You can do this by deleting it from your package manager's lockfile and re-installing the dependencies.@babel/core>=7.23.2 will automatically pull in a non-vulnerable version. - If you cannot upgrade
@babel/traverseand are using one of the affected packages mentioned above, upgrade them to their latest version to avoid triggering the vulnerable code path in affected@babel/traverseversions:@babel/plugin-transform-runtimev7.23.2@babel/preset-envv7.23.2@babel/helper-define-polyfill-providerv0.4.3babel-plugin-polyfill-corejs2v0.4.6babel-plugin-polyfill-corejs3v0.8.5babel-plugin-polyfill-es-shimsv0.10.0babel-plugin-polyfill-regeneratorv0.5.3
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @babel/traverse | all versions | 7.23.2npm install @babel/traverse@7.23.2 |
| 📦npm | @babel/traverse | ≥ 8.0.0-alpha.0&&< 8.0.0-alpha.4 | 8.0.0-alpha.4npm install @babel/traverse@8.0.0-alpha.4 |
| 📦npm | babel-traverse | all versions | No fix |
Affected Products
babelbabeljsbabel-helper-define-polyfill-providerbabeljsbabel-plugin-polyfill-corejs2babeljsbabel-plugin-polyfill-corejs3babeljsbabel-plugin-polyfill-es-shimsbabeljsbabel-plugin-polyfill-regeneratorbabeljsDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @babel/traverse, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @babel/traverse to 7.23.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2023-45133 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Red Hat Satellite does not directly use any affected components, but some of the packages it ships with contain them in the form of a dependency. However, the chances of exploitation are low because the build environment for Satellite is restricted, with limited opportunity for injecting untrusted code. Therefore, the…
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.Source: Red Hat security advisory for CVE-2023-45133 (CC BY 4.0)
Frequently Asked Questions
Is CVE-2023-45133 in your dependencies?
Find it across npm, including transitive dependencies.