CVE-2026-34452

Claude SDK for Python: Memory Tool Path Validation Race Condition Allows Sandbox Escape

Published Mar 31, 2026 CVSS 4.0 · 5.8 Medium EPSS < 1% KEV · Not listed
Description
The Claude SDK for Python provides access to the Claude API from Python applications. From version 0.86.0 to before version 0.87.0, 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. This issue has been patched in version 0.87.0.

Analysis

AI-generated

Technical impact

The vulnerability is a race condition in the asynchronous memory tool of the Anthropic Python SDK that allows a locally privileged attacker to bypass sandbox isolation by manipulating path validation. A requested path is validated to stay inside the sandboxed memory directory, but the tool returns the unresolved path for subsequent file operations. This permits an attacker who can create a symbolic link after validation to redirect reads or writes outside the intended directory, potentially accessing sensitive files or modifying system data. The weakness falls under CWE-367 and CWE-59.

Affected Systems

The affected vendor is Anthropics, product Anthropic Python SDK. Versions from 0.86.0 through just before 0.87.0 contain the flaw. Users of older libraries or custom forks that have not applied the patch are susceptible. The issue is specific to the asynchronous implementation; the synchronous memory tool is unaffected.

Risk and Exploitability

CVSS score is 5.8 indicating moderate severity. As exploitation requires local write access to the SDK's memory directory, the attack surface is limited to environments where the application runs with sufficient permissions. No EPSS score or KEV listing is available, but the moderate CVSS combined with the local privilege requirement suggests restricted exploitation risk. Updating to version 0.87.0 removes the race condition, limiting the potential for sandbox escape.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade anthropic-sdk-python to version 0.87.0 or later.
  • Verify that your environment uses the updated SDK and that no older version remains in the dependency tree.
  • If you cannot upgrade immediately, restrict write permissions to the SDK's memory directory or disable the asynchronous memory tool.
  • Perform application testing to confirm that sandbox isolation is preserved and no unintended file access occurs.

Generated by OpenCVE AI on April 1, 2026 at 06:04 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-w828-4qhx-vxx3 Claude SDK for Python: Memory Tool Path Validation Race Condition Allows Sandbox Escape
History
Type Values Removed Values Added
First Time appeared Anthropic
Anthropic claude Sdk For Python
CPEs cpe:2.3:a:anthropic:claude_sdk_for_python:*:*:*:*:*:python:*:*
Vendors & Products Anthropic
Anthropic claude Sdk For Python
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N'}

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Anthropics
Anthropics anthropic-sdk-python
Vendors & Products Anthropics
Anthropics anthropic-sdk-python
Type Values Removed Values Added
Description The Claude SDK for Python provides access to the Claude API from Python applications. From version 0.86.0 to before version 0.87.0, 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. This issue has been patched in version 0.87.0.
Title Claude SDK for Python: Memory Tool Path Validation Race Condition Allows Sandbox Escape
Weaknesses CWE-367
CWE-59
References
Metrics cvssV4_0

{'score': 5.8, 'vector': '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'}

Weaknesses
  • CWE-367

    Time-of-check Time-of-use (TOCTOU) Race Condition

  • CWE-59

    Improper Link Resolution Before File Access ('Link Following')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Apr 3, 2026, 4:08 PM
Reserved
Mar 27, 2026, 6:18 PM
Status
Analyzed
Published
Mar 31, 2026, 10:16 PM
Modified
Jul 24, 2026, 9:10 PM