-
fix(cli): enforce sensitive-file upload denylist (GHSA-hp3h-89pf-5q58) (#3763)
发布于
2026-07-06 20:30:40 +00:00 This PR:
- fixes #3746 / GHSA-hp3h-89pf-5q58 — the CLI's tool file-upload path
bypassed the sensitive-file denylist - root cause: the denylist was enforced at the caller layer, so
@composio/cli's duplicate upload path (readFileFromDisk) read and
uploaded any local path a tool argument pointed at —~/.ssh/id_rsa,
~/.aws/credentials,.env, etc. — enabling credential exfiltration
viacomposio execute/composio run(incl. LLM-driven agents hit by
prompt injection) - unified fix: one canonical guard, exported from
@composio/core
and enforced at the read primitive in every SDK core: the guard now routes fs/path access through the internal
#platformabstraction (adds arealpathSyncmethod), so it carries
no staticnode:*imports and is exported from the package root:
assertSafeFileUploadPath,isBlockedSensitiveFileUploadPath,
BUILTIN_FILE_UPLOAD_PATH_DENY_SEGMENTScli:readFileFromDiskcalls the sharedassertSafeFileUploadPath
beforefs.readFile; URLs andFileobjects are unaffected (matches
core)python: already routes all uploads through the guarded
FileUploadable.from_path— no functional change; adds regression tests
for parity- supersedes #3755, which exported the then-node-only guard from core's
mainindex.tsand would have injectednode:fsinto the shared
dist/index.mjs(the workerd/edge-light entry), likely breaking
Cloudflare Workers / Vercel Edge - changesets:
@composio/coreminor (new public exports),
@composio/clipatch (security fix)
Verification
- core: full suite passes (997), incl. new root-export +
realpath-symlink cases - edge bundle stays clean: built
dist/index.mjshas no static
node:*imports and reaches the platform only via#platform - cli: new regression test drives the real
uploadToolInputFiles → readFileFromDisk → guardchain —~/.ssh/id_rsaand.envthrow
ComposioSensitiveFilePathBlockedErrorbefore anycreatePresignedURL
call; a normal file still uploads - python:
test_files.py+ sensitive-path suite pass (145), incl. 3 new
from_pathguard tests tsgotypecheck + eslint clean for core and cli
下载附件
- fixes #3746 / GHSA-hp3h-89pf-5q58 — the CLI's tool file-upload path