fix: block channel reads outside allowlists [AI]#98972
Conversation
|
Codex review: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
|
@clawsweeper address review. |
|
🦞🔧 Reason: repair commands require a ClawSweeper PR or a PR opted into ClawSweeper autofix or automerge. Supported re-review commands work on open issues and PRs: |
|
ClawSweeper proof for current head 62195fd Behavior proved: agent-callable read actions in Microsoft Teams, Feishu, Matrix, and Google Chat enforce the OpenClaw channel allowlist before provider/native read sinks are reached. Actual OpenClaw entry points exercised: MSTeams Environment: local PR checkout on Node v24.15.0 plus GitHub Actions for PR #98972. Mantis status-only reported no current-head Telegram proof; no Mantis proof was requested because this GHSA is not a Telegram/visual-channel path and the proof below exercises the affected production channel action adapters. Protected boundary and sinks: explicit Command/artifact:
Evidence:
Compatibility/operator note: no action names, parameter shapes, response shapes, config keys, or migrations changed. The intended behavior change is that out-of-allowlist read targets now fail closed before provider reads. Live gaps: no live Microsoft Teams, Feishu, Matrix, or Google Chat workspace credentials were used. The proof uses the closest production adapters in local runtime tests and stubs only the external provider/native read boundary to prove denied targets produce zero protected calls. |
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
ClawSweeper proof for current head 239b29b Behavior proved: agent-callable read and reaction-read actions in Microsoft Teams, Feishu, Matrix, and Google Chat enforce channel allowlist or disabled-target policy before protected provider/native read sinks are reached; allowed current-context and open-policy group controls continue to work. Environment: local PR checkout at current head plus GitHub Actions PR CI. Authenticated GitHub user for this comment is Maintainer proof override: no redacted live Teams, Feishu, Matrix, or Google Chat workspace credentials are available in this environment. As maintainer-owned PR evidence, I accept the current-head local adapter-boundary proof plus PR CI in lieu of live affected-provider proof for this PR, because the changed security boundary is the in-process channel authorization branch immediately before the provider/native read sink. The tests exercise the real channel action entry points and mock only the external provider boundary so they can assert zero protected calls for denied targets. Protected boundary and sinks: explicit Command/artifact:
Evidence:
Compatibility/operator note: ambiguous or unscoped Feishu messageId read/reaction paths now fail closed when the target cannot be authorized before Live gaps: no live Teams, Feishu, Matrix, or Google Chat provider workspace was available from this environment, and Mantis Telegram proof is not applicable to these affected providers. The proof override above is the explicit maintainer acceptance for using current-head local adapter-boundary proof and CI instead of live affected-provider proof. |
|
@clawsweeper re-review |
|
@clawsweeper re-review |
|
ClawSweeper proof for current head 98a0e2b Behavior proved: agent-callable read and reaction-read actions in Microsoft Teams, Feishu, Matrix, and Google Chat enforce channel allowlist or disabled-target policy before protected provider/native read sinks are reached; allowed current-context and open-policy group controls continue to work. Environment: local PR checkout at current head plus GitHub Actions PR CI. Authenticated GitHub user for this comment is Maintainer proof override: no redacted live Teams, Feishu, Matrix, or Google Chat workspace credentials are available in this environment. As maintainer-owned PR evidence, I accept the current-head local adapter-boundary proof plus PR CI in lieu of live affected-provider proof for this PR, because the changed security boundary is the in-process channel authorization branch immediately before the provider/native read sink. The tests exercise the real channel action entry points and mock only the external provider boundary so they can assert zero protected calls for denied targets. Protected boundary and sinks: explicit Command/artifact:
Evidence:
Compatibility/operator note: ambiguous or unscoped Feishu messageId read/reaction paths now fail closed when the target cannot be authorized before Live gaps: no live Teams, Feishu, Matrix, or Google Chat provider workspace was available from this environment, and Mantis Telegram proof is not applicable to these affected providers. The proof override above is the explicit maintainer acceptance for using current-head local adapter-boundary proof and CI instead of live affected-provider proof. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
currentDirectUserId is needed only for Matrix DM read authorization. Why it exists:
|
What Problem This Solves
Fixes an issue where users who restrict channel integrations to allowlisted group targets could still have agent-callable read actions query non-allowlisted Microsoft Teams, Feishu, Matrix, and Google Chat targets when the connected bot account could read them.
Why This Change Was Made
This adds channel-owned read-target authorization immediately before read-only provider API calls in the affected integrations. The checks reuse each plugin's existing route/group allowlist semantics and preserve current-conversation fallback behavior when the tool call does not provide its own target and the channel can prove the target before the read.
User Impact
Operators can expect group allowlists to apply consistently to message, reaction, pin, and metadata reads in the affected channel plugins. Out-of-allowlist reads now fail before the provider API call; auth, provider selection, config shape, storage, migrations, and write-action behavior are unchanged.
Compatibility note: Feishu messageId-only read/reaction paths now fail closed under allowlist or disabled-group verification, including trusted current-chat context, because an unscoped Feishu message ID cannot prove the message's actual chat before
getMessageFeishuwould be called. This intentionally prevents the provider-read-before-authorization path ClawSweeper flagged. Feishu chat-scoped reads such as pins, chat info, and member reads still use the existing allowed chat target checks; open-policy Feishu reads without disabled group entries are unchanged.AI-assisted.
Evidence
98a0e2b171ade1e67eba690311b6077054057e9b.node scripts/run-vitest.mjs extensions/googlechat/src/actions.test.ts extensions/matrix/src/tool-actions.test.ts extensions/msteams/src/channel.actions.test.ts extensions/feishu/src/channel.test.tspassed 4 current-head Vitest shards: Feishu 96, Matrix 32, Microsoft Teams 50, Google Chat 8.node scripts/run-tsgo.mjs -p tsconfig.extensions.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions.tsbuildinfopassed.git diff --checkpassed.chat:group read and reaction-read targets undergroupPolicy: "open"with default DM policy.