Packages / @babel/traverse / Security

CriticalVulnerabilityGHSA-67hx-6x53-jw92CVE-2023-45133Published 16 Oct 2023

Babel vulnerable to arbitrary code execution when compiling specifically crafted malicious code

Affected releases · @babel/traverse

  • 7.x7.0.0 – 7.23.0Fixed in 7.23.2

On 7.x, the newest line:

npm install @babel/traverse@7.23.2
8.x
  1. Not affected

    8.0.0 – 8.0.7

    5 releases, latest

7.x
  1. Affected

    7.0.0 – 7.23.0

    110 releases

  2. Fixed

    7.23.2 – 7.29.10

    42 releases

157 stable releases of @babel/traverse, oldest to newest, one row per major.

Is your project affected?

Paste your package.json, or type the range you declare for @babel/traverse. It is read in your browser and sent nowhere.

What happens

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:

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/traverse@7.23.2.

Babel 6 does not receive security fixes anymore (see Babel's security policy), hence there is no patch planned for babel-traverse@6.

Workarounds