CVE-2023-45133: Babel vulnerable to arbitrary code execution

@babel/traverse Updated 02 Oct 2025

Summary

16/10/2023
Yes i
Critical
9.3

CVE-2023-45133: Babel vulnerable to arbitrary code execution when compiling specifically crafted malicious code. Affects @babel/traverse across 2 version ranges.

< 7.23.2 >= 8.0.0-alpha.0, < 8.0.0-alpha.4

Fixed in 7.23.2 or 8.0.0-alpha.4, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2023-45133 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Babel is an open-source JavaScript compiler that allows developers to write code using the latest ECMAScript standards and transpile it into backward-compatible versions. It is widely used in the JavaScript ecosystem to enable modern language features in older environments. However, a vulnerability has been discovered in Babel that can lead to arbitrary code execution during compilation when using certain plugins.

Vulnerability Detail

The vulnerability in Babel arises when compiling code that has been specifically crafted by an attacker. It affects plugins that rely on the path.evaluate() or path.evaluateTruthy() internal Babel methods. This can result in arbitrary code execution during the compilation process. Notably, plugins such as @babel/plugin-transform-runtime and @babel/preset-env (with the useBuiltIns option) are known to be affected. Third-party plugins may also be impacted. It is important to note that this vulnerability does not affect users who only compile trusted code.

How To Fix

Latest published version: 8.0.7 as of 22 Oct 2026

npm install @babel/traverse@8.0.7

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 7.23.2 7.23.2
    npm install @babel/traverse@7.23.2
  • >= 8.0.0-alpha.0, < 8.0.0-alpha.4 8.0.0-alpha.4
    npm install @babel/traverse@8.0.0-alpha.4

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If you cannot upgrade @babel/traverse and are using one of the affected packages, you can upgrade them to their latest versions to avoid triggering the vulnerable code path. For example, upgrade @babel/plugin-transform-runtime to v7.23.2, @babel/preset-env to v7.23.2, @babel/helper-define-polyfill-provider to v0.4.3, babel-plugin-polyfill-corejs2 to v0.4.6, babel-plugin-polyfill-corejs3 to v0.8.5, babel-plugin-polyfill-es-shims to v0.10.0, and babel-plugin-polyfill-regenerator to v0.5.3.

Conclusion

In conclusion, Babel is vulnerable to arbitrary code execution when compiling specifically crafted malicious code. To mitigate this vulnerability, it is crucial to upgrade @babel/traverse to version 7.23.2 or higher. If upgrading is not possible, ensure that the affected packages are updated to their latest versions. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for @babel/traverse →

Share this vulnerability

FAQ

Babel is an open-source JavaScript compiler that allows developers to write code using the latest ECMAScript standards and transpile it into backward-compatible versions.

Known affected plugins are @babel/plugin-transform-runtime, @babel/preset-env (with useBuiltIns option), and any "polyfill provider" plugin that depends on @babel/helper-define-polyfill-provider.

If you cannot upgrade @babel/traverse, you can upgrade the affected packages to their latest versions to avoid triggering the vulnerable code path.

No, users who only compile trusted code are not impacted by this vulnerability.

You can find more information about this vulnerability in the GitHub Advisory Database.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Latest published version: 8.0.7 as of 22 Oct 2026

npm install @babel/traverse@8.0.7

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 7.23.2 7.23.2
    npm install @babel/traverse@7.23.2
  • >= 8.0.0-alpha.0, < 8.0.0-alpha.4 8.0.0-alpha.4
    npm install @babel/traverse@8.0.0-alpha.4

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback