Invia #862563: nanocoai NanoClaw 2.0.64 Improper Limitation of a Pathname to a Restricted Directory (CWE-22)informazioni

Titolonanocoai NanoClaw 2.0.64 Improper Limitation of a Pathname to a Restricted Directory (CWE-22)
Descrizione# Technical Details An Arbitrary Local File Exfiltration via `send_file` absolute path exists in the `send_file` tool handler in `container/agent-runner/src/mcp-tools/core.ts` of NanoClaw. The application fails to restrict file reads to trusted roots. The `send_file` MCP tool explicitly accepts absolute filesystem paths and copies the referenced file into the outbound outbox without any allowlist, `realpath` canonicalization, or containment check. When an absolute path is provided, the code resolves it unchanged and only checks existence before copying: `const resolvedPath = path.isAbsolute(filePath) ? filePath : path.resolve('/workspace/agent', filePath)`. This allows a prompt-injected agent to exfiltrate arbitrary container-visible files, including files mounted under `/workspace/extra/*`. # Vulnerable Code File: container/agent-runner/src/mcp-tools/core.ts Method: send_file tool handler (lines ~136-176) — resolves absolute paths without root restriction, copies to outbox Why: No allowlist of permitted local roots, no containment enforcement. The agent runner also auto-discovers directories under /workspace/extra/* and exposes them to the runtime, making sensitive mounts realistically reachable. # Reproduction 1. Create `/workspace/agent/docs/allowed.txt` and `/workspace/extra/secret-mount/canary.txt`. 2. Start the built-in MCP stdio server and invoke `send_file` with `docs/allowed.txt` (relative, allowed) and `/workspace/extra/secret-mount/canary.txt` (absolute, should be blocked). 3. Observe both files are staged into `/workspace/outbox/<message_id>/` for outbound delivery. # Impact - Arbitrary local file read leading to data exfiltration through NanoClaw's outbound attachment pipeline. - A prompt-injected or compromised agent can export local documents, internal artifacts, or other readable files to external messaging destinations. - Sensitive mounted directories under `/workspace/extra/*` are directly reachable.
Fonte⚠️ https://github.com/nanocoai/nanoclaw/issues/2760
Utente
 JohnChen (UID 99088)
Sottomissione18/06/2026 08:51 (2 mesi fa)
Moderazione05/08/2026 20:48 (2 months later)
StatoAccettato
Voce VulDB386367 [nanocoai NanoClaw fino a 2.0.64 send_file core.ts directory traversal]
Punti20

Do you need the next level of professionalism?

Upgrade your account now!