CVE-2026-34451: Claude SDK for TypeScript: Memory Tool Path Validation Allows Sandbox Escape to Sibling Directories
The local filesystem memory tool in @anthropic-ai/sdk for TypeScript, versions 0.79.0 up to 0.81.0, checks paths with a string prefix test. A prompt-injected model can reach a sibling directory such as memories_backup and read or write files outside the memory root. Upgrade to 0.81.0.
Published Apr 1, 2026 · Updated Apr 24, 2026 · Analysis Oct 31, 2026
What an attacker can do
The memory tool confines model-supplied paths to a memory root, for example /memories. It did this with startsWith(resolvedRoot) and no trailing path separator. A directory named /memories_backup also starts with /memories, so it passed as if it were inside the root. The check ran in two places: the path check of BetaLocalFilesystemMemoryTool and validateNoSymlinkEscape in src/tools/memory/node.ts.
The attacker does not touch the host directly. They need to steer the model, for example through prompt injection in a web page or document the agent reads. The model then asks the memory tool for a crafted path. The result is read and write access to any sibling directory whose name begins with the memory root's name. Reach is limited to those siblings, which is why severity is medium (CVSS 4.0 score 6.3, attack complexity high).
Who is affected
npm package @anthropic-ai/sdk, versions >= 0.79.0 and < 0.81.0, when your app uses the local filesystem memory tool (BetaLocalFilesystemMemoryTool). Risk is real only if a sibling directory shares the memory root's name as a prefix. Check your version:
npm ls @anthropic-ai/sdk@anthropic-ai/sdk
- Ecosystem
- npm
- Affected
- >= 0.79.0, < 0.81.0
- Fixed in
- 0.81.0
- Check
npm ls @anthropic-ai/sdk
How to fix it
Upgrade to @anthropic-ai/sdk 0.81.0:
npm install @anthropic-ai/[email protected]The fix (commit 0ac69b3) accepts a path only if it equals the root or starts with the root plus path.sep. As a precaution, avoid placing other directories next to the memory root under a name that extends it, and review what the agent could reach.
How to tell if you were hit
Look at the host for sibling directories that share the memory root's name as a prefix, such as a memories_backup next to memories, and check them for files you did not write or recent changes. Log memory tool calls and look for paths that use .. segments or symlinks. A blocked attempt on the fixed version throws a would escape /memories directory error.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
The local filesystem memory tool in the Anthropic TypeScript SDK validated model-supplied paths using a string prefix check that did not append a trailing path separator. A model steered by prompt injection could supply a crafted path that resolved to a sibling directory sharing the memory root's name as a prefix, allowing reads and writes outside the sandboxed memory directory.
Users on the affected versions are advised to update to the latest version.
Claude SDK for TypeScript thanks hackerone.com/nicksim for reporting this issue!
Questions
- Does CVE-2026-34451 need local access?
No. The vector is network-based. A model steered by prompt injection supplies the crafted path, so the attacker only needs to get hostile text in front of the agent.
- Which directories can be reached?
Only sibling directories whose names start with the memory root's name, such as memories_backup next to memories. It is not arbitrary file access.
- What version fixes it?
@anthropic-ai/sdk 0.81.0. Versions from 0.79.0 up to, but not including, 0.81.0 are affected.
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-34452
Claude SDK for Python: Memory Tool Path Validation Race Condition Allows Sandbox Escape
medium5.3Apr 1, 2026
