PyPI: anthropic

CVE-2026-34452

Safety vulnerability ID: SFTY-20260401-18581

Safety legacy ID: pyup.io-91355

Affected versions of the anthropic package are vulnerable to a Time-of-Check Time-of-Use Race Condition due to the async local filesystem memory tool validating that model-supplied paths resolve inside the sandboxed memory directory, but then returning the unresolved path for subsequent file operations. An attacker with write access to the memory directory could retarget a symlink between the validation and use steps, causing the async memory tool to read or write files outside the intended sandbox. This allows a local attacker to escape the sandbox boundary, potentially accessing or modifying sensitive files on the host filesystem.

Created at: Apr 3, 2026Updated at: Apr 3, 2026

Overview

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

Advisory

Affected versions of the anthropic package are vulnerable to a Time-of-Check Time-of-Use Race Condition due to the async local filesystem memory tool validating that model-supplied paths resolve inside the sandboxed memory directory, but then returning the unresolved path for subsequent file operations. An attacker with write access to the memory directory could retarget a symlink between the validation and use steps, causing the async memory tool to read or write files outside the intended sandbox. This allows a local attacker to escape the sandbox boundary, potentially accessing or modifying sensitive files on the host filesystem.

Affected Package

Affecting anthropic package, versions
>=0.86.0,<0.87.0

Also affects

---

How to Fix

Upgrade
anthropic
to
0.87.0
or higher.

Mitigation and Workarounds

---

Vulnerable Functions

Functions linked to known vulnerabilities.

Vulnerable function data is available for Enterprise customers

Book a call with us to see Safety in action.

Safety

Verified by Safety

Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.

Learn more