Submit #1077285: letta-ai Letta Code (@letta-ai/letta-code) 0.34.39 (commit df234ac178ed4719ba72732342534a9255c487e1) Path Traversalinfo

Titelletta-ai Letta Code (@letta-ai/letta-code) 0.34.39 (commit df234ac178ed4719ba72732342534a9255c487e1) Path Traversal
BeschreibungLetta Code (@letta-ai/letta-code), the current supported Letta implementation (the legacy Python letta server is retired/out-of-scope per vendor SECURITY.md), is affected by an incorrect-authorization / path-traversal issue (CWE-863, CWE-22, CWE-59). Its permission layer and its file tools canonicalize the tool file_path differently: authorization matches/contains the RAW path with resolve(cwd, raw) and does NOT expand ~ on the query path, never expands $HOME/${VAR}, and never applies fs.realpath (src/permissions/matcher.ts:101-112; src/permissions/checker.ts:619-651; query built at checker.ts:251 via extractFilePath, src/permissions/cross-agent-guard.ts:215-217; the permission check runs on raw args at src/tools/manager.ts:1067). The file tools expand ~, $HOME, ${VAR} via expandFilePath() (src/utils/file-path.ts:11-28) and then use fs, with no containment re-check after expansion (src/tools/impl/read.ts:244). The read-family tools Read/Glob/Grep/ListDir are auto-allowed when their target resolves "within the working directory" by a built-in containment check (src/permissions/checker.ts:50-57 WORKING_DIRECTORY_TOOLS, checker.ts:525), active in the default standard permission mode and skipped only in strict mode. That check is path-based, dotfile-agnostic, and uses the raw path, so Read("$HOME/.ssh/id_rsa") (or "~/.aws/credentials", "${HOME}/.letta/config.json") resolves for the permission check to <cwd>/$HOME/.ssh/id_rsa (lexically within the workspace, so it is auto-allowed with no prompt and no allow rule required) while the tool reads the real ~/.ssh/id_rsa and returns it. No $VAR expansion is required: the ~/... variant works via expandFilePath's tilde branch alone. A defensive deny rule is also bypassed: deny Read(~/.ssh/**) expands ~ on the pattern side but the query path is the raw <cwd>/$HOME/.ssh/id_rsa, so it never matches. A symlink variant needs no ~/$VAR at all: containment is purely lexical (no fs.realpath) and the tool uses fs (follows symlinks), so a non-dot symlink committed in an untrusted repository (docs -> /home/<user>/.ssh) makes Read("docs/id_rsa") return the host file; neither guard stops it (workspaceSandboxGuard is opt-in and off by default, and cross-agent-guard only protects other agents' memory directories, not general host files). Reachability: Letta Code channel bots (Discord/Slack/WhatsApp) default to standard mode (src/channels/config.ts:204,210) and default dmPolicy "pairing" plus an allowedUsers allowlist, so a paired/allowed (often low-trust) chat user can make the bot exfiltrate host secrets; local CLI use reaches the same via indirect prompt injection on an untrusted repository. Impact: confidentiality - arbitrary read of out-of-workspace files, including SSH private keys, cloud credentials, and Letta's own API keys/config stored under $HOME. Affected: @letta-ai/letta-code 0.34.39 (commit df234ac178ed4719ba72732342534a9255c487e1). CVSS 3.1: AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N (Base 7.7). PoC (fake data only): in default standard mode, an agent tool call Read("$HOME/.ssh/id_rsa") returns ~/.ssh/id_rsa with no prompt and no allow rule; Read("docs/id_rsa"), where docs is an in-workspace symlink to ~/.ssh, returns the host key; and with deny Read(~/.ssh/**) configured, Read("$HOME/.ssh/id_rsa") is still not denied. A full runnable proof of concept (functions copied verbatim from commit df234ac; sandboxed, fake $HOME) was provided to the vendor and is available on request. Vendor status: vendor informed at [email protected] on 2026-11-06 per the project SECURITY.md (coordinated and responsible disclosure).
Benutzer
 YujinShin (UID 102118)
Einreichung06.11.2026 03:04 (vor 27 Tagen)
Moderieren02.12.2026 18:18 (27 days later)
StatusAkzeptiert
VulDB Eintrag447951 [letta-ai letta-code bis 0.34.77 Permission Checker checker.ts isWithinAllowedDirectories file_path Directory Traversal]
Punkte17

Want to stay up to date on a daily basis?

Enable the mail alert feature now!