security(zalo): scope pairing approvals to accountId#26121
Merged
steipete merged 3 commits intoopenclaw:mainfrom Mar 2, 2026
Merged
security(zalo): scope pairing approvals to accountId#26121steipete merged 3 commits intoopenclaw:mainfrom
steipete merged 3 commits intoopenclaw:mainfrom
Conversation
Author
|
@greptileai please run security/code review on this PR. |
fff821a to
e4483dc
Compare
Contributor
|
Landed via temp rebase onto main.
Thanks @bmendonca3! |
obviyus
pushed a commit
that referenced
this pull request
Mar 2, 2026
Linux2010
pushed a commit
to Linux2010/openclaw
that referenced
this pull request
Mar 2, 2026
execute008
pushed a commit
to execute008/openclaw
that referenced
this pull request
Mar 2, 2026
dawi369
pushed a commit
to dawi369/davis
that referenced
this pull request
Mar 3, 2026
OWALabuy
pushed a commit
to kcinzgg/openclaw
that referenced
this pull request
Mar 4, 2026
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
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
Zalo DM pairing authorization used channel-level pairing-store access without threading
accountId, allowing pairing approvals from one Zalo account to influence DM authorization on another Zalo account in the same gateway runtime.This patch scopes both pairing-store reads and pairing-request writes to the active account.
Change Type
Scope
extensions/zalo/src/monitor.tsextensions/zalo/src/monitor.webhook.test.tsSecurity Impact
Fixes an authz/session-isolation bypass in multi-account Zalo deployments:
accountId, preventing cross-account approval bleed.Repro + Verification
Deterministic repro (before fix)
defaultandwork) withdmPolicy=pairing.123ondefault.123towork.Post-fix behavior
123is not implicitly allowlisted onworkunless paired forwork.Regression test
readAllowFromStore("zalo", undefined, accountId)upsertPairingRequest({ ..., accountId })Test command
pnpm exec vitest run --config vitest.extensions.config.ts extensions/zalo/src/monitor.group-policy.test.ts extensions/zalo/src/monitor.webhook.test.ts --maxWorkers=113 passed).Evidence
Dedupe search (no matching open/closed issue/PR found for this exact cross-account Zalo pairing scope bug):
Human Verification
Compatibility / Migration
Failure Recovery
Risks and Mitigations
Greptile Summary
Fixes a critical authorization bypass in multi-account Zalo deployments where pairing approvals from one account could authorize DM access on another account within the same gateway runtime.
The fix correctly scopes pairing operations to
accountIdby:account.accountIdas the third parameter toreadAllowFromStore("zalo", undefined, accountId)atextensions/zalo/src/monitor.ts:361accountId: account.accountIdto theupsertPairingRequestcall atextensions/zalo/src/monitor.ts:382The regression test validates both operations are properly scoped and will prevent future regressions.
Confidence Score: 4/5
zalouserextensionzalouserappears to have the identical vulnerability pattern that should be addressed in a follow-upextensions/zalouser/src/monitor.tsfor the same vulnerability patternLast reviewed commit: 1a025d3