VDB
Sign up
MEDIUM5.4

GHSA-5474-4w2j-mq4c

Claude SDK for TypeScript: Memory Tool Path Validation Allows Sandbox Escape to Sibling Directories

Quick fix

GHSA-5474-4w2j-mq4c — @anthropic-ai/sdk: upgrade to the fixed version with the command below.

npm install @anthropic-ai/sdk@0.81.0

Details

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](https://hackerone.com/nicksim) for reporting this issue!

Are you affected?

Enter the version of the package you're using.

Affected packages

npm/@anthropic-ai/sdk
Introduced in: 0.79.0Fixed in: 0.81.0
Fixnpm install @anthropic-ai/sdk@0.81.0

References