Fix @babel/traverse vulnerability (CVE-2023-45133) - #2
Merged
Conversation
Upgrade @babel/traverse to fix arbitrary code execution vulnerability during Babel compilation. ## Changes - Added `overrides` section to package.json to force `@babel/traverse` to version `^7.23.2` - This override applies to all transitive dependencies that pull in @babel/traverse (@babel/core, @babel/helpers, @babel/helper-module-transforms) ## Why The vulnerable version (7.18.13) allows arbitrary code execution when compiling untrusted code with Babel plugins that use `path.evaluate()` or `path.evaluateTruthy()` methods. The override ensures that regardless of which package pulls in @babel/traverse, the patched version 7.23.2+ is always used. After running `npm install`, the lock file will be regenerated with the secure version. ## Semgrep Finding Details Affected versions of @babel/traverse and babel-traverse are vulnerable to Incomplete List of Disallowed Inputs / Incorrect Comparison. Compiling untrusted code with Babel using plugins that invoke the internal path.evaluate() or path.evaluateTruthy() methods (for example @babel/plugin-transform-runtime, @babel/preset-env with useBuiltIns, or any polyfill‐provider plugin) allows a maliciously crafted AST to execute arbitrary code on the build machine during compilation. Semgrep generated this Autofix PR for [this finding](https://semgrep.dev/orgs/octane_lending_poc/supply-chain/findings/683929575) from the detection rule [ssc-17eda294-146f-4ed3-91f7-5ef1b349d687](https://semgrep.dev/orgs/-/supply-chain/advisories?q=ssc-17eda294-146f-4ed3-91f7-5ef1b349d687).
Semgrep autofix added the overrides section to package.json but didn't run npm install, leaving the lock file with the vulnerable @babel/traverse @7.18.13 and many mismatched transitive deps, causing npm ci to fail. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
patrickwang1990
marked this pull request as ready for review
June 8, 2026 16:48
Previous lock file was generated without npm auth, producing incorrect resolved URLs and integrity hashes. Clean reinstall with auth produces a valid lock file that npm ci can consume. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previous lock files pointed to octanelending.jfrog.io (local npm config), causing E401 in CI which has no JFrog credentials. Regenerated using --registry=https://registry.npmjs.org to match main branch convention. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrade @babel/traverse to fix arbitrary code execution vulnerability during Babel compilation.
Changes
overridessection to package.json to force@babel/traverseto version^7.23.2Why
The vulnerable version (7.18.13) allows arbitrary code execution when compiling untrusted code with Babel plugins that use
path.evaluate()orpath.evaluateTruthy()methods. The override ensures that regardless of which package pulls in @babel/traverse, the patched version 7.23.2+ is always used. After runningnpm install, the lock file will be regenerated with the secure version.Semgrep Finding Details
Affected versions of @babel/traverse and babel-traverse are vulnerable to Incomplete List of Disallowed Inputs / Incorrect Comparison. Compiling untrusted code with Babel using plugins that invoke the internal path.evaluate() or path.evaluateTruthy() methods (for example @babel/plugin-transform-runtime, @babel/preset-env with useBuiltIns, or any polyfill‐provider plugin) allows a maliciously crafted AST to execute arbitrary code on the build machine during compilation.
Semgrep generated this Autofix PR for this finding from the detection rule ssc-17eda294-146f-4ed3-91f7-5ef1b349d687.