CVE-2025-59828: Claude Code Vulnerable to Arbitrary Code Execution via Plugin Autoloading with Specific Yarn Versions

Published Sep 24, 2025
·
Updated

Summary

In Claude Code versions prior to 1.0.39, when the tool is used with Yarn 2.x or newer (Berry), Yarn plugins are automatically loaded and executed when running yarn --version. In Claude Code this sequence could execute plugin code before the user accepts the directory trust prompt for an untrusted workspace, resulting in a potential arbitrary code execution path. Yarn Classic (v1) is not affected. The issue is fixed in 1.0.39.

Impact

An attacker who can influence the project directory to include or reference a malicious Yarn plugin, or who can otherwise cause plugin execution in an untrusted directory, may achieve code execution on the machine where Claude Code is invoked. The vulnerability compromises the confidentiality, integrity and availability of the vulnerable host process.

Remediation

Update Claude Code to 1.0.39 or later. Users on auto-update channels receive the fix automatically; manual installations should upgrade explicitly. As defense in depth, avoid running Yarn in untrusted directories and prefer Yarn Classic when plugin functionality is not required.

Background

Yarn 2+ supports a plugin architecture in which plugins are loaded at runtime and can inject behavior into Yarn commands; this capability underpins the observed auto-execution on yarn --version.

---

> Thank you to https://hackerone.com/michel for reporting this issue!

Other sources

Claude Code is an agentic coding tool. Prior to Claude Code version 1.0.39, when using Claude Code with Yarn versions 2.0+, Yarn plugins are auto-executed when running yarn --version. This could lead to a bypass of the directory trust dialog in Claude Code, as plugins would be executed prior to the user accepting the risks of working in an untrusted directory. Users running Yarn Classic were unaffected by this issue. This issue has been fixed in version 1.0.39. Users on standard Claude Code auto-update will have received this fix automatically. Users performing manual updates are advised to update to the latest version.

MITRE

Affected Software

2 affected componentsFixes available
npm/@anthropic-ai/claude-code<1.0.39
1.0.39
anthropic Claude Code Node.js<1.0.39

Event History

Sep 24, 2025
Advisory Published
via GitHub·06:57 PM
Data Sourced
via GitHub·06:57 PM
DescriptionWeaknessAffected Software
CVE Published
via MITRE·07:30 PM
Data Sourced
via MITRE·07:30 PM
DescriptionWeakness
Data Sourced
via NVD·08:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:15 PM
Affected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-59828?

CVE-2025-59828 has been identified as a significant vulnerability due to its ability to bypass the directory trust dialog.

2

How do I fix CVE-2025-59828?

To fix CVE-2025-59828, upgrade to Claude Code version 1.0.39 or later.

3

What software versions are affected by CVE-2025-59828?

CVE-2025-59828 affects all versions of Claude Code prior to 1.0.39 when used with Yarn versions 2.0 and above.

4

What risks are associated with CVE-2025-59828?

The primary risk associated with CVE-2025-59828 is that unauthorized Yarn plugins could execute without user consent, leading to potential code execution vulnerabilities.

5

Does CVE-2025-59828 require immediate attention?

Yes, CVE-2025-59828 should be addressed promptly to mitigate the risk of exploitation through untrusted Yarn plugins.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203