Skip to content

fix(security): confine send_file reads to /workspace (CVE-2026-29611)#2799

Open
sturdy4days wants to merge 2 commits into
nanocoai:mainfrom
sturdy4days:fix/send-file-path-confinement
Open

fix(security): confine send_file reads to /workspace (CVE-2026-29611)#2799
sturdy4days wants to merge 2 commits into
nanocoai:mainfrom
sturdy4days:fix/send-file-path-confinement

Conversation

@sturdy4days

Copy link
Copy Markdown
Contributor

What

send_file accepts an absolute path and copies the file into the outbox after only an existence check — no root restriction, no canonicalization. A prompt-injected or compromised agent can read any container-visible file (credential state, files under /workspace/extra/* mounts) and exfiltrate it through the normal attachment path.

Reported as CVE-2026-29611 / #2760 (High, <= 2.0.64, unpatched).

How it works

  • Confine the resolved source path to /workspace — an absolute path outside it is rejected.
  • basename() the display name as well: path.join(outboxDir, filename) resolves .., so a crafted filename could otherwise write outside the outbox and overwrite an active skill (instruction injection on the next spawn). This closes the write-side of the same path-handling flaw.

Legitimate sends are unaffected — agent files live under /workspace/agent, inbox/outbox, and /workspace/extra/*, all within /workspace.

How it was tested

Container typecheck passes. The identical change runs in a downstream fork with the existing core.test.ts plus the full container suite (236) green.

Closes #2760

…isplay name

send_file accepts an absolute `path` and copies it into the outbox after only
an existence check, with no root restriction — a prompt-injected agent can
exfiltrate any container-readable file (credential state, /workspace/extra/*
mounts). Reported as CVE-2026-29611 (nanocoai#2760), High, unpatched.

Confine the resolved source to /workspace, and basename the display name so a
`..`-laden filename can't path.join() its way out of the outbox and overwrite
an active skill (instruction injection on the next spawn).

Closes nanocoai#2760
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Security] Arbitrary local file exfiltration via send_file absolute path handling

1 participant