Cherry-pick bbab94c1f: security(feishu): bind doc create grants to trusted requester context (#31184)#1488
Merged
alexey-pelykh merged 3 commits intomainfrom Mar 16, 2026
Conversation
…openclaw#31184) Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit bbab94c)
- Restore isFeishuDocToolEnabled() with local audit-prefixed helpers (auditAsRecord, auditHasNonEmptyString) since the upstream originals were removed during fork security audit cleanup - Fix vi.fn() mock parameter typing in plugin context test
The security commit switched feishu_doc registration from plain-object to factory pattern (for ctx.requesterSenderId access). Update the image hardening test to resolve the tool from either a factory or plain object.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of openclaw/openclaw@bbab94c1f.
Subject: security(feishu): bind doc create grants to trusted requester context (openclaw#31184)
Conflict resolution:
extensions/feishu/src/docx.ts— switched feishu_doc tool registration from plain-object style to factory pattern(ctx) => { ... }to accessctx.requesterSenderIdfor trusted requester context (required by security fix). Kept fork'sgetClient()(no args) andmediaMaxBytes(pre-computed) patterns. Applied upstream'screateDocsignature change to options object.src/security/audit.ts— restored the Feishu doc security audit finding that was previously removed in fork; applied upstream's updated message text (now says "trusted requesting Feishu user" instead of "owner_open_id").src/security/audit.test.ts— restored corresponding test cases with upstream's updated descriptions; fixed config type fromOpenClawConfigtoRemoteClawConfig.src/agents/openclaw-tools.plugin-context.test.ts— renamed toremoteclaw-tools.plugin-context.test.ts, updated import path and function name tocreateRemoteClawTools.Cherry-picked-from: openclaw/openclaw@bbab94c1f
Co-authored-by: Tak Hoffman [email protected]