security(imessage): scope pairing-store auth to accountId#26688
Closed
bmendonca3 wants to merge 2 commits intoopenclaw:mainfrom
Closed
security(imessage): scope pairing-store auth to accountId#26688bmendonca3 wants to merge 2 commits intoopenclaw:mainfrom
bmendonca3 wants to merge 2 commits intoopenclaw:mainfrom
Conversation
|
This pull request has been automatically marked as stale due to inactivity. |
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.
Summary
iMessage inbound DM pairing auth in
monitor-providerused channel-level pairing-store reads/writes withoutaccountId. In multi-account iMessage setups, approvals/pairing state from one account could influence DM authorization decisions in another account on the same gateway.This PR scopes both pairing-store read and pairing-request upsert to the active iMessage account.
Change Type
Scope
src/imessage/monitor/monitor-provider.tssrc/imessage/monitor/monitor-provider.account-scope.test.tsSecurity Impact
Repro + Verification
Deterministic repro (local)
accountA,accountB) withdmPolicy: pairing.accountAand approve.accountB.accountId, preventing cross-account authorization leakage.Automated verification
All pass.
Evidence
Human Verification
readChannelAllowFromStore("imessage", process.env, accountInfo.accountId)upsertChannelPairingRequest({ ..., accountId: accountInfo.accountId })Compatibility / Migration
Failure Recovery
dmPolicy: openwhile account-specific pairing entries are re-established.Risks and Mitigations
Greptile Summary
Adds
accountIdparameter toreadChannelAllowFromStoreandupsertChannelPairingRequestcalls in iMessage monitor to prevent cross-account authorization leakage in multi-account gateway setups. The pairing-store functions already supportaccountIdscoping (lines 334-351 and 471-498 inpairing-store.ts), and this PR ensures the iMessage monitor uses that parameter correctly.Confidence Score: 5/5
accountIdscoping to existing pairing-store functions that already support this parameter. The implementation is minimal (2 call sites updated), the test verifies the fix works as intended, and Telegram already uses this pattern correctly (line 398 inbot-handlers.ts). No logic errors or edge cases identified.Last reviewed commit: b414440