Skip to content

fix(feishu): propagate mediaLocalRoots for local file sends (#27884)#27928

Merged
Takhoffman merged 2 commits intoopenclaw:mainfrom
joelnishanth:fix/feishu-local-media-roots
Feb 27, 2026
Merged

fix(feishu): propagate mediaLocalRoots for local file sends (#27884)#27928
Takhoffman merged 2 commits intoopenclaw:mainfrom
joelnishanth:fix/feishu-local-media-roots

Conversation

@joelnishanth
Copy link
Copy Markdown
Contributor

Summary

Fixes #27884 -- Feishu extension cannot send local files after CVE-2026-26321 security patch.

Root cause: After CVE-2026-26321, loadWebMedia requires explicit localRoots to allow reading local file paths. The Feishu outbound adapter was not propagating mediaLocalRoots from the ChannelOutboundContext through to sendMediaFeishu / loadWebMedia, so any local path was rejected with a path-not-allowed error.

Fix: Thread mediaLocalRoots from the outbound context through feishuOutbound.sendMedia into sendMediaFeishu, which passes it as localRoots to loadWebMedia. This matches the pattern already used by Telegram, Discord, Slack, Signal, iMessage, and WhatsApp adapters.

Changes

  • extensions/feishu/src/media.ts -- add mediaLocalRoots parameter to sendMediaFeishu; pass it as localRoots to loadWebMedia
  • extensions/feishu/src/outbound.ts -- destructure mediaLocalRoots from outbound context and forward to sendMediaFeishu
  • extensions/feishu/src/media.test.ts -- add regression test asserting mediaLocalRoots flows through as localRoots

Test plan

@openclaw-barnacle openclaw-barnacle bot added channel: feishu Channel integration: feishu size: XS labels Feb 26, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 26, 2026

Greptile Summary

Fixes #27884 by propagating mediaLocalRoots from the outbound context through to loadWebMedia, enabling local file sends after the CVE-2026-26321 security patch. The implementation follows the established pattern used by Telegram, Discord, Slack, Signal, iMessage, and WhatsApp adapters.

Key changes:

  • Threaded mediaLocalRoots parameter through feishuOutbound.sendMediasendMediaFeishuloadWebMedia
  • Added regression test verifying mediaLocalRoots flows through as localRoots
  • Used defensive check (?.length) to ensure empty arrays fall back to default roots

The implementation is clean, well-tested, and consistent with security requirements.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix is straightforward and follows an established pattern used across multiple channel adapters in the codebase. The changes are minimal, focused, and include a regression test. The implementation correctly propagates the security-critical mediaLocalRoots parameter through the call chain to restore local file sending functionality after the CVE patch.
  • No files require special attention

Last reviewed commit: d5be2c0

@openclaw-barnacle openclaw-barnacle bot added the agents Agent runtime and tooling label Feb 26, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@openclaw-barnacle openclaw-barnacle bot added app: macos App: macos size: S and removed size: XS labels Feb 26, 2026
@Takhoffman Takhoffman force-pushed the fix/feishu-local-media-roots branch from a6f64d5 to ece162b Compare February 27, 2026 23:43
@openclaw-barnacle openclaw-barnacle bot added size: XS and removed app: macos App: macos agents Agent runtime and tooling size: S labels Feb 27, 2026
@Takhoffman Takhoffman merged commit ad804b0 into openclaw:main Feb 27, 2026
10 checks passed
@Takhoffman
Copy link
Copy Markdown
Contributor

PR #27928 - fix(feishu): propagate mediaLocalRoots for local file sends (#27884) (#27928)

Merged via squash.

  • Merge commit: ad804b0
  • Verified: pnpm build, pnpm check, pnpm test:macmini
  • Changes made:
    M CHANGELOG.md
  • Why these changes were made:
    Add required changelog entry for the user-facing Feishu local media fix so autoland policy can merge.
  • Changelog: CHANGELOG.md updated=true required=true opt_out=false

Thanks @joelnishanth!

r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
…#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]>
xiexikang pushed a commit to C-clawd/cclawd that referenced this pull request Feb 28, 2026
…#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]>
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 28, 2026
…#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]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…#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]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…#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)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…#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)
vincentkoc pushed a commit to Sid-Qin/openclaw that referenced this pull request Feb 28, 2026
…#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]>
vincentkoc pushed a commit to rylena/rylen-openclaw that referenced this pull request Feb 28, 2026
…#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]>
newtontech pushed a commit to newtontech/openclaw-fork that referenced this pull request Feb 28, 2026
…#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]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
…#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]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
…#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]>
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
…#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
ansh pushed a commit to vibecode/openclaw that referenced this pull request Mar 2, 2026
…#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]>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…#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]>
safzanpirani pushed a commit to safzanpirani/clawdbot that referenced this pull request Mar 2, 2026
…#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]>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…#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]>
venjiang pushed a commit to venjiang/openclaw that referenced this pull request Mar 2, 2026
…#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]>
robertchang-ga pushed a commit to robertchang-ga/openclaw that referenced this pull request Mar 2, 2026
…#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]>
execute008 pushed a commit to execute008/openclaw that referenced this pull request Mar 2, 2026
…#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]>
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
…#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
dorgonman pushed a commit to kanohorizonia/openclaw that referenced this pull request Mar 3, 2026
…#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]>
eminemead pushed a commit to eminemead/evi that referenced this pull request Mar 3, 2026
…#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)
sachinkundu pushed a commit to sachinkundu/openclaw that referenced this pull request Mar 6, 2026
…#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]>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…#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]>
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 15, 2026
…#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)
alexey-pelykh added a commit to remoteclaw/remoteclaw that referenced this pull request Mar 15, 2026
…#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]>
eminemead pushed a commit to eminemead/evi that referenced this pull request Mar 27, 2026
…#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)
eminemead pushed a commit to eminemead/evi that referenced this pull request Mar 27, 2026
…#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)
eminemead pushed a commit to eminemead/evi that referenced this pull request Mar 27, 2026
…#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)
eminemead pushed a commit to eminemead/evi that referenced this pull request Mar 27, 2026
…#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)
eminemead pushed a commit to eminemead/evi that referenced this pull request Mar 27, 2026
…#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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: feishu: Cannot send local files after CVE-2026-26321 security patch

2 participants