CVE-2026-34452: Claude SDK for Python: Memory Tool Path Validation Race Condition Allows Sandbox Escape
The async memory tool in the Anthropic Python SDK 0.86.x has a time-of-check/time-of-use race. It validated a path, then used the unresolved path, so a symlink swapped in between could send reads or writes outside the memory directory. The sync tool is not affected. Upgrade to anthropic 0.87.0.
Published Apr 1, 2026 · Updated Apr 24, 2026 · Analysis Oct 31, 2026
What an attacker can do
In the async local filesystem memory tool, _validate_path confirmed that the resolved path stayed inside the memory root. It then returned the unresolved full_path. A symlink such as /memories/link could pass validation and be repointed, for example at /etc, before the file operation ran. The operation followed the new target.
The attacker must be local and able to write to the memory directory, and must win a race, so CVSS 4.0 rates it 5.8 (local, high complexity, low privileges). The gain is read access to files outside the sandbox and some write access. This matters for multi-tenant hosts or containers where several users or processes share the memory folder that an agent also uses.
Who is affected
pip package anthropic, versions >= 0.86.0 and < 0.87.0, only for the async memory tool (AsyncPath based). The synchronous memory tool returned the resolved path and is not affected. Check the installed version:
pip show anthropicanthropic
- Ecosystem
- PyPI
- Affected
- >= 0.86.0, < 0.87.0
- Fixed in
- 0.87.0
- Check
pip show anthropic
How to fix it
Upgrade to anthropic 0.87.0:
pip install --upgrade anthropic==0.87.0Commit 6599043 changes the async validator to return AsyncPath(resolved_path), so the file operation uses the real location and not the symlink. Until then, make sure untrusted users cannot write to the memory directory, or use the sync tool.
How to tell if you were hit
Search the memory directory for symlinks, for example with find using -type l, and check where they point. Symlinks that target paths outside the memory root are suspect. Review file access logs for the agent process touching files outside the memory path. Races leave little trace, so the advisory gives no log signature.
Original advisory
From the GitHub Advisory Database (CC BY 4.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.
Users on the affected versions are advised to update to the latest version.
Claude SDK for Python thanks hackerone.com/kasthelord for reporting this issue!
Questions
- Is the synchronous memory tool affected by CVE-2026-34452?
No. Only the async implementation returned the unresolved path. The sync version already returned the resolved one.
- What does an attacker need?
Local write access to the memory directory and a way to retarget a symlink between the check and the file operation. Attack complexity is rated high.
- Which version is patched?
anthropic 0.87.0, which also fixes the file-permission issue CVE-2026-34450 in the same release.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Anthropic SDKs vulnerabilities
All Anthropic SDKs entriesCVE-2026-41686
Claude SDK for TypeScript has Insecure Default File Permissions in Local Filesystem Memory Tool
medium4.8Apr 29, 2026CVE-2026-34450
Claude SDK for Python has Insecure Default File Permissions in Local Filesystem Memory Tool
medium4.8Apr 1, 2026CVE-2026-34451
Claude SDK for TypeScript: Memory Tool Path Validation Allows Sandbox Escape to Sibling Directories
medium5.4Apr 1, 2026
