Packages / @anthropic-ai/sdk / Security
Claude SDK for TypeScript: Memory Tool Path Validation Allows Sandbox Escape to Sibling Directories
Affected releases · @anthropic-ai/sdk
- 0.80.x0.80.0No fix on this line yet
- 0.79.x0.79.0No fix on this line yet
0.80.x has no fix yet; the newest fixed line:
npm install @anthropic-ai/sdk@0.81.0Not affected
1.0.0 – 1.1.0
2 releases, latest
Not affected
0.2.0 – 0.78.0
143 releases
Affected
0.79.0 – 0.80.0
2 releases
Fixed
0.81.0 – 0.137.0
72 releases
Is your project affected?
Paste your package.json, or type the range you declare for @anthropic-ai/sdk. It is read in your browser and sent nowhere.
What happens
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!