Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CVE–2023–45133 #6661

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

debricked[bot]
Copy link
Contributor

@debricked debricked bot commented Jan 26, 2024

CVE–2023–45133

This bumps several babel-plugin-polyfill packages /@etnoy

Vulnerability details

Description

Incorrect Comparison

The product compares two entities in a security-relevant context, but the comparison is incorrect, which may lead to resultant weaknesses.

NVD

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/traverse@7.23.2 and @babel/traverse@8.0.0-alpha.4. 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.

GitHub

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

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-env when using its useBuiltIns option
  • 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.

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

  • Upgrade @babel/traverse to 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/traverse and 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/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
CVSS details - 8.8

 

CVSS3 metrics
Attack Vector Local
Attack Complexity Low
Privileges Required Low
User interaction None
Scope Changed
Confidentiality High
Integrity High
Availability High
References

    NVD - CVE-2023-45133
    Babel vulnerable to arbitrary code execution when compiling specifically crafted malicious code · CVE-2023-45133 · GitHub Advisory Database · GitHub
    Arbitrary code execution when compiling specifically crafted malicious code · Advisory · babel/babel · GitHub
    Only evaluate own String/Number/Math methods (#16033) · babel/babel@b13376b · GitHub
    Only evaluate own String/Number/Math methods by nicolo-ribaudo · Pull Request #16033 · babel/babel · GitHub
    Release v8.0.0-alpha.4 · babel/babel · GitHub
    Release v7.23.2 · babel/babel · GitHub
    [SECURITY] [DSA 5528-1] node-babel7 security update
    [SECURITY] [DLA 3618-1] node-babel security update
    CVE-2023-45133: Finding an Arbitrary Code Execution Vulnerability In Babel · Babel

 

Related information

📌 Remember! Check the changes to ensure they don't introduce any breaking changes.
📚 Read more about the CVE

 

Copy link

cloudflare-pages bot commented Jan 26, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 90517b0
Status: ✅  Deploy successful!
Preview URL: https://26a04930.immich.pages.dev
Branch Preview URL: https://debricked-fix-cve-2023-45133.immich.pages.dev

View logs

@etnoy etnoy added the dependencies Pull requests that update a dependency file label Jan 26, 2024
@alextran1502 alextran1502 merged commit 741ce04 into main Jan 26, 2024
25 of 26 checks passed
@alextran1502 alextran1502 deleted the debricked-fix-CVE_2023_45133-6b011b9de0065e52 branch January 26, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants