Skip to content

GHSA-9f65-56v6-gxw7 CVE-2025-52882

Claude Code Improper Authorization via websocket connections from arbitrary origins

High npm
Severity
0.0 / 10
High · CVSS 4.0
Exploit chance (EPSS)
0.36%
Chance of exploitation in the next 30 days. Higher than 29.42% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-1385 Missing Origin Validation in WebSockets
CWE-285 Improper Authorization
Fix
1.0.24
Upgrade @anthropic-ai/claude-code to this version or later

Description

Claude Code extensions in VSCode and forks (e.g., Cursor, Windsurf, and VSCodium) and JetBrains IDEs (e.g., IntelliJ, Pycharm, and Android Studio) are vulnerable to unauthorized websocket connections from an attacker when visiting attacker-controlled webpages. Claude Code for VSCode IDE extensions versions 0.2.116 through 1.0.23 are vulnerable. For Jetbrains IDE plugins, Claude Code [beta] versions 0.1.1 through 0.1.8 are vulnerable.

In VSCode (and forks), exploitation would allow an attacker to read arbitrary files, see the list of files open in the IDE, get selection and diagnostics events from the IDE, or execute code in limited situations where a user has an open Jupyter Notebook and accepts a malicious prompt. In JetBrains IDEs, an attacker could get selection events, a list of open files, and a list of syntax errors.

Remediation

We released a patch for this issue on June 13th, 2025. Although Claude Code auto-updates when you launch it and auto-updates the extensions, you should take the following steps (the exact steps depend on your IDE).

VSCode, Cursor, Windsurf, VSCodium, and other VSCode forks Extension Name: Claude Code for VSCode

Instructions:

  1. Open the list of Extensions (View->Extensions)
  2. Look for Claude Code for VSCode among installed extensions
  3. If you have a version < 1.0.24, click “Update” (or “Uninstall”)
  4. Restart the IDE

All JetBrains IDEs including IntelliJ, PyCharm, and Android Studio Plugin name: Claude Code [Beta]

Instructions:

  1. Open the Plugins list
  2. Look for Claude Code [Beta] among installed extensions
  3. Update (or Uninstall) the plugin if the version is < 0.1.9
  4. Restart the IDE

Affected versions

npm

PackageVulnerableFixed in
@anthropic-ai/claude-code
>= 0.2.116, < 1.0.24
1.0.24

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

@anthropic-ai/claude-code npm → 1.0.24

npm
npm install @anthropic-ai/claude-code@1.0.24
yarn
yarn add @anthropic-ai/claude-code@1.0.24
pnpm
pnpm add @anthropic-ai/claude-code@1.0.24

Severity breakdown

CVSS 4.0 0.0

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N

Attack vector
Network
Attack complexity
Low
Attack requirements
Present
Privileges required
None
User interaction
Passive
Confidentiality (vulnerable system)
High
Integrity (vulnerable system)
High
Availability (vulnerable system)
None
Confidentiality (subsequent systems)
High
Integrity (subsequent systems)
High
Availability (subsequent systems)
None

Weakness

CWE-1385: Missing Origin Validation in WebSockets

The product uses a WebSocket, but it does not properly verify that the source of data or communication is valid.

How to prevent it
  • Implementation: Enable CORS-like access restrictions by verifying the 'Origin' header during the WebSocket handshake.
  • Implementation: Use a randomized CSRF token to verify requests.
  • Implementation: Use TLS to securely communicate using 'wss' (WebSocket Secure) instead of 'ws'.
  • Architecture and Design, Implementation: Require user authentication prior to the WebSocket connection being established. For example, the WS library in Node has a 'verifyClient' function.
  • Implementation: Leverage rate limiting to prevent against DoS. Use of the leaky bucket algorithm can help with this.
  • Implementation: Use a library that provides restriction of the payload size. For example, WS library for Node includes 'maxPayloadoption' that can be set.
  • Implementation: Treat data/input as untrusted in both directions and apply the same data/input sanitization as XSS, SQLi, etc.

CWE-285: Improper Authorization

The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.

How to prevent it
  • Architecture and Design: Divide the product into anonymous, normal, privileged, and administrative areas. Reduce the attack surface by carefully mapping roles with data and functionality. Use role-based access control (RBAC) to enforce the roles at the appropriate boundaries. Note that this approach may not protect against horizontal authorization, i.e., it will not protect a user from attacking others with the same role.
  • Architecture and Design: Ensure that you perform access control checks related to your business logic. These checks may be different than the access control checks that you apply to more generic resources such as files, connections, processes, memory, and database records. For example, a database may restrict access for medical records to a specific database user, but each record might only be intended to be accessible to the patient and the patient's doctor.
  • Architecture and Design: Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, consider using authorization frameworks such as the JAAS Authorization Framework [REF-233] and the OWASP ESAPI Access Control feature [REF-45].
  • Architecture and Design: For web applications, make sure that the access control mechanism is enforced correctly at the server side on every page. Users should not be able to access any unauthorized functionality or information by simply requesting direct access to that page. One way to do this is to ensure that all pages containing sensitive information are not cached, and that all such pages restrict access to requests that are accompanied by an active and authenticated session token associated with a user who has the required permissions to access that page.
  • System Configuration, Installation: Use the access control capabilities of your operating system and server environment and define your access control lists accordingly. Use a "default deny" policy when defining these ACLs.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-pq7j-f95f-qfcv
Claude Code: Plugin Hash Pin Bypass Allows Bypass of Hash Pinning
High Also affects @anthropic-ai/claude-code
GHSA-7835-87q9-rgvv
Claude Code: Sandbox Escape via Git Worktree Path Confusion Allows Unsandboxed Code Execution
High Also affects @anthropic-ai/claude-code
GHSA-4vp2-6q8c-pvq2
@anthropic-ai/claude-code has an Insecure Temporary File in /copy Command that Enables Response Disclosure and Symlink-Based File Write
Medium Also affects @anthropic-ai/claude-code
GHSA-fg94-h982-f3mm
Claude Code: Out-of-Band Data Exfiltration via Pre-Approved HuggingFace Domain in WebFetch
Critical Also affects @anthropic-ai/claude-code
GHSA-q5hj-mxqh-vv77
Claude Code: Trust Dialog Bypass via Git Worktree Spoofing Allows Arbitrary Code Execution
High Also affects @anthropic-ai/claude-code
GHSA-vp62-r36r-9xqp
Claude Code: Sandbox Escape via Symlink Following Allows Arbitrary File Write Outside Workspace
Critical Also affects @anthropic-ai/claude-code
GHSA-5cwg-9f6j-9jvx
Claude Code: Insecure System-Wide Configuration Loading Enables Local Privilege Escalation on Windows
High Also affects @anthropic-ai/claude-code
GHSA-mmgp-wc2j-qcv7
Claude Code has a Workspace Trust Dialog Bypass via Repo-Controlled Settings File
High Also affects @anthropic-ai/claude-code
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor