Vulnerabilities in pkg:pypi/anthropic

PACKAGE
Advisory Identifier: GHSA-w828-4qhx-vxx3
Advisory Summary

CVE-2026-34452 is a MODERATE (CVSS 5.3) memory tool path validation race vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting Claude SDK for Python libraries in the PyPI ecosystem. The issue involves memory tool path validation race condition allows sandbox escape. Remediation is available by upgrading affected packages to version 0.87.0.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/anthropic

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/anthropic. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-w828-4qhx-vxx3 CVE-2026-34452 MODERATE Claude SDK for Python: Memory Tool Path Validation Race Condition Allows Sandbox Escape
GHSA-q5f5-3gjm-7mfm CVE-2026-34450 MODERATE Claude SDK for Python has Insecure Default File Permissions in Local Filesystem Memory Tool

CVE-2026-34452 at a Glance

CVE Identifier CVE-2026-34452
GHSA Identifier GHSA-w828-4qhx-vxx3
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
Affected Product Claude SDK for Python
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-34452

To remediate this vulnerability, upgrade all affected Claude SDK for Python dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

anthropic fixed: 0.87.0
pip install anthropic>=0.87.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show anthropic

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-34452, inspect your installed packages using pip:

pip show anthropic

Analyze the terminal output to locate any version of Claude SDK for Python in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.87.0), your application is affected.

Note: The pip show anthropic command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. In Claude SDK for Python, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

The async local filesystem memory tool in the Anthropic Python SDK validated that model-supplied paths resolved inside the sandboxed memory directory, but then returned the unresolved path for subsequent file operations. A local attacker able to write to the memory directory could retarget a symlink between validation and use, causing reads or writes to escape the sandbox. The synchronous memory tool implementation was not affected. Users on the affected versions are advised to update to the latest version. Claude SDK for Python thanks [hackerone.com/kasthelord](https://hackerone.com/kasthelord) for reporting this issue!

CVE-2026-34452 Affected Claude SDK for Python Versions

1 component(s)
Fixed Versions:
0.87.0
Product / Package Ecosystem Affected Versions Fixed Version
anthropic
PyPI
≥ 0.86.0
< 0.87.0
0.87.0

References

Frequently Asked Questions

What is CVE-2026-34452?
CVE-2026-34452 is a security vulnerability in Claude SDK for Python involving Memory Tool Path Validation Race Condition Allows Sandbox Escape under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition.
Which Claude SDK for Python versions are affected?
Affected versions include releases prior to 0.87.0 across affected packages: anthropic.
What version fixes CVE-2026-34452?
Upgrading to 0.87.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is anthropic affected?
Yes, anthropic is affected in releases prior to 0.87.0. Upgrade your dependency to 0.87.0 or later.
What is the CVSS score of CVE-2026-34452?
CVE-2026-34452 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2026-34452?
CVE-2026-34452 is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition (The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.).
How can I check PyPI dependencies for CVE-2026-34452?
Run the dependency tree command: 'pip show anthropic'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w828-4qhx-vxx3",
  "modified" : "2026-04-24T20:59:08Z",
  "published" : "2026-04-01T21:17:34Z",
  "aliases" : [ "CVE-2026-34452" ],
  "summary" : "Claude SDK for Python: Memory Tool Path Validation Race Condition Allows Sandbox Escape",
  "details" : "The async local filesystem memory tool in the Anthropic Python SDK validated that model-supplied paths resolved inside the sandboxed memory directory, but then returned the unresolved path for subsequent file operations. A local attacker able to write to the memory directory could retarget a symlink between validation and use, causing reads or writes to escape the sandbox. The synchronous memory tool implementation was not affected.\n\nUsers on the affected versions are advised to update to the latest version.\n\nClaude SDK for Python thanks [hackerone.com/kasthelord](https://hackerone.com/kasthelord) for reporting this issue!",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:H/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "anthropic"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.86.0"
      }, {
        "fixed" : "0.87.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/anthropics/anthropic-sdk-python/security/advisories/GHSA-w828-4qhx-vxx3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34452"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/anthropics/anthropic-sdk-python/commit/6599043eee6e86dce16953fcd1fd828052052be6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/anthropics/anthropic-sdk-python"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/anthropics/anthropic-sdk-python/releases/tag/v0.87.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-367", "CWE-59" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-01T21:17:34Z",
    "nvd_published_at" : "2026-03-31T22:16:20Z"
  }
}