fix(feishu): propagate mediaLocalRoots for local file sends (#27884)#27928
fix(feishu): propagate mediaLocalRoots for local file sends (#27884)#27928Takhoffman merged 2 commits intoopenclaw:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d5be2c0ade
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const loaded = await getFeishuRuntime().media.loadWebMedia(mediaUrl, { | ||
| maxBytes: mediaMaxBytes, | ||
| optimizeImages: false, | ||
| localRoots: mediaLocalRoots?.length ? mediaLocalRoots : undefined, |
There was a problem hiding this comment.
Preserve empty localRoots allowlist when forwarding roots
The new forwarding logic converts an explicitly empty mediaLocalRoots array into undefined, which changes caller intent from “deny all local paths” to “use default roots.” In loadWebMedia, undefined triggers getDefaultLocalRoots() while [] would reject all local paths, so a caller that passes mediaLocalRoots: [] (for strict lockdown) will now unexpectedly allow reads under default directories. This should pass mediaLocalRoots through unchanged so empty arrays remain fail-closed.
Useful? React with 👍 / 👎.
Greptile SummaryFixes #27884 by propagating Key changes:
The implementation is clean, well-tested, and consistent with security requirements. Confidence Score: 5/5
Last reviewed commit: d5be2c0 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8554abf101
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const loaded = await getFeishuRuntime().media.loadWebMedia(mediaUrl, { | ||
| maxBytes: mediaMaxBytes, | ||
| optimizeImages: false, | ||
| localRoots: mediaLocalRoots?.length ? mediaLocalRoots : undefined, |
There was a problem hiding this comment.
Honor empty mediaLocalRoots in loadWebMedia call
The new localRoots assignment treats an explicit empty allowlist as undefined (mediaLocalRoots?.length ? mediaLocalRoots : undefined), which changes behavior from “deny all local paths” to “use default roots.” In loadWebMedia/assertLocalMediaAllowed, undefined falls back to getDefaultLocalRoots() while [] would reject every local path, so callers that intentionally pass mediaLocalRoots: [] (fail-closed) now silently allow reads under default directories.
Useful? React with 👍 / 👎.
a6f64d5 to
ece162b
Compare
|
PR #27928 - fix(feishu): propagate mediaLocalRoots for local file sends (#27884) (#27928) Merged via squash.
Thanks @joelnishanth! |
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit 6a83767)
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit 6a83767)
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit ad804b0) # Conflicts: # CHANGELOG.md # extensions/feishu/src/media.test.ts # extensions/feishu/src/media.ts # extensions/feishu/src/outbound.ts
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit ad804b0) # Conflicts: # CHANGELOG.md # extensions/feishu/src/media.test.ts # extensions/feishu/src/media.ts # extensions/feishu/src/outbound.ts
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit ad804b0)
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit ad804b0)
…#27884) (openclaw#27928) thanks @joelnishanth (#1449) Verified: - pnpm build - pnpm check - pnpm test:macmini (cherry picked from commit ad804b0) Co-authored-by: OfflynAI <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit ad804b0)
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit ad804b0)
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit ad804b0)
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit ad804b0)
…#27884) (openclaw#27928) thanks @joelnishanth Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: joelnishanth <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit ad804b0)
Summary
Fixes #27884 -- Feishu extension cannot send local files after CVE-2026-26321 security patch.
Root cause: After CVE-2026-26321,
loadWebMediarequires explicitlocalRootsto allow reading local file paths. The Feishu outbound adapter was not propagatingmediaLocalRootsfrom theChannelOutboundContextthrough tosendMediaFeishu/loadWebMedia, so any local path was rejected with a path-not-allowed error.Fix: Thread
mediaLocalRootsfrom the outbound context throughfeishuOutbound.sendMediaintosendMediaFeishu, which passes it aslocalRootstoloadWebMedia. This matches the pattern already used by Telegram, Discord, Slack, Signal, iMessage, and WhatsApp adapters.Changes
extensions/feishu/src/media.ts-- addmediaLocalRootsparameter tosendMediaFeishu; pass it aslocalRootstoloadWebMediaextensions/feishu/src/outbound.ts-- destructuremediaLocalRootsfrom outbound context and forward tosendMediaFeishuextensions/feishu/src/media.test.ts-- add regression test assertingmediaLocalRootsflows through aslocalRootsTest plan
pnpm test extensions/feishu/src/media.test.ts)mediaLocalRootsis empty/undefined, falls back to default roots (fail-closed)