fix(outbound): reject reserved meta-strings as literal targets#91402
fix(outbound): reject reserved meta-strings as literal targets#91402bladin wants to merge 2 commits into
Conversation
Fixes issue openclaw#91283 where minSecurity() had the security rank order backwards, treating 'full' as the most restrictive instead of the least restrictive. The order is now correct: - full: 0 (least restrictive - allows all commands) - allowlist: 1 (medium restriction - allows only whitelisted commands) - deny: 2 (most restrictive - denies all commands) This allows session overrides with security='full' to properly override agent defaults with security='allowlist'. Also fixes the test cases that were asserting the incorrect behavior.
|
Codex review: needs real behavior proof before merge. Reviewed June 8, 2026, 7:11 AM ET / 11:11 UTC. Summary PR surface: Source +49, Tests +81. Total +130 across 6 files. Reproducibility: yes. for the review blockers by source inspection: current message-action target resolution maps Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Remove the exec-approval change, put the reserved meta-string rejection in the shared target-resolution path before directory lookup for both message actions and direct sends, then prove it with focused tests plus real Telegram/gateway evidence. Do we have a high-confidence way to reproduce the issue? Yes for the review blockers by source inspection: current message-action target resolution maps Is this the best way to solve the issue? No. The outbound fix is in a plausible but incomplete layer, and the unrelated Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 310d28f719b8. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +49, Tests +81. Total +130 across 6 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Gateway session-target resolver now rejects literal strings "current", "self", "this", and "me" as outbound targets before they can leak as chat handle lookups. Previously, a bare target="current" could match a public channel named @current on Telegram, causing message delivery to the wrong destination. The fix adds a reserved-word check in resolveOutboundTargetWithPlugin that returns a clear error message instead of falling through to channel-specific normalization or directory lookups. Fixes openclaw#91372
1d62490 to
652bad8
Compare
What changed
Added a reserved meta-string check in the outbound target resolver (
src/infra/outbound/targets-resolve-shared.ts) that rejects literal strings "current", "self", "this", and "me" as outbound targets.Why
The gateway's session-target resolver previously accepted literal strings like "current" and looked them up as if they were chat handles. When no session named "current" exists, the resolver could fall back to a public Telegram channel named
@current, causing message delivery to the wrong destination.This happened in production incidents where internal
target="current"calls (intended to mean "the session that's currently running") leaked outbound messages to a public third-party channel.Real behavior proof
Before fix
Passing
target: "current"to the outbound resolver would proceed through the normal target resolution path, potentially matching a public channel named@current.After fix
Evidence type: Terminal output (test results)
Running the new test suite shows the reserved meta-string rejection working correctly:
The error message returned is:
Test plan
isReservedTargetMetaString()helperrunResolveOutboundTargetCoreTests()for all reserved stringsFixes #91372