Skip to content

Cherry-pick bbab94c1f: security(feishu): bind doc create grants to trusted requester context (#31184)#1488

Merged
alexey-pelykh merged 3 commits intomainfrom
cherry-pick/bbab94c1f-feishu-security
Mar 16, 2026
Merged

Cherry-pick bbab94c1f: security(feishu): bind doc create grants to trusted requester context (#31184)#1488
alexey-pelykh merged 3 commits intomainfrom
cherry-pick/bbab94c1f-feishu-security

Conversation

@alexey-pelykh
Copy link
Copy Markdown

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 access ctx.requesterSenderId for trusted requester context (required by security fix). Kept fork's getClient() (no args) and mediaMaxBytes (pre-computed) patterns. Applied upstream's createDoc signature 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 from OpenClawConfig to RemoteClawConfig.
  • src/agents/openclaw-tools.plugin-context.test.ts — renamed to remoteclaw-tools.plugin-context.test.ts, updated import path and function name to createRemoteClawTools.
  • CHANGELOG.md removed per fork convention.

Cherry-picked-from: openclaw/openclaw@bbab94c1f
Co-authored-by: Tak Hoffman [email protected]

Takhoffman and others added 3 commits March 16, 2026 02:54
- 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.
@alexey-pelykh alexey-pelykh merged commit 8e36041 into main Mar 16, 2026
7 checks passed
@alexey-pelykh alexey-pelykh deleted the cherry-pick/bbab94c1f-feishu-security branch March 16, 2026 02:19
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.

2 participants