Repository navigation
Route sensitive group commands to the owner privately - #73872
Conversation
🔒 Aisle Security AnalysisWe found 1 potential security issue(s) in this PR:
1. 🔵 Cross-channel owner identifier collision can misroute private owner-only command replies
Description
In
Because This can cause private routing of sensitive owner-only outputs (e.g. Vulnerable code: if (to) {
keys.add(to);
keys.add(`user:${to}`);
}RecommendationTighten owner matching so it cannot cross channels unless the config entry is explicitly channel-qualified. Recommended change:
Example safer implementation: function buildPrivateCommandRouteOwnerKeys(target: PrivateCommandRouteTarget): Set<string> {
const channel = normalizeLowercaseStringOrEmpty(target.channel);
const to = normalizeLowercaseStringOrEmpty(target.to);
const keys = new Set<string>();
if (channel && to) {
keys.add(`${channel}:${to}`);
if (channel === "telegram") keys.add(`tg:${to}`);
}
return keys;
}If unprefixed owner IDs must remain supported for backward compatibility, scope them to a specific channel during matching (e.g., only treat an unprefixed owner entry as matching when Analyzed PR: #73872 at commit Last updated on: 2026-04-29T00:09:50Z |
Greptile SummaryThis PR refactors Confidence Score: 5/5This PR is safe to merge; the routing logic is well-tested and no correctness or security issues were identified. All changed paths are covered by new and updated tests that exercise both the same-surface preference and the cross-surface fallback. The sorting is deterministic when ownerAllowFrom is configured (the documented requirement). Deduplication and seen-set channel enumeration are correct. No P0 or P1 findings. No files require special attention. Reviews (1): Last reviewed commit: "fix(commands): route sensitive group app..." | Re-trigger Greptile |
|
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Keep this PR open. It is member-authored and has the protected Best possible solution: Keep this PR open for maintainer review. The likely path is to refine and land the focused resolver/handler changes after addressing the cross-channel owner identity matching question, so sensitive group What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against fd2625a16252. |
|
Aisle was right here. I pushed |
|
ClawSweeper’s routing-order open question is covered by the focused resolver tests: the new test registry registers multiple native approval-capable channel plugins, verifies same-surface owner DMs win even when another owner route is listed first, verifies fallback follows |
|
Added the explicit ergonomics regression coverage in |
* fix(commands): route sensitive group approvals privately * fix(commands): require owner private routes * test(commands): cover owner-derived Telegram diagnostics routing
* fix(commands): route sensitive group approvals privately * fix(commands): require owner private routes * test(commands): cover owner-derived Telegram diagnostics routing
* fix(commands): route sensitive group approvals privately * fix(commands): require owner private routes * test(commands): cover owner-derived Telegram diagnostics routing
* fix(commands): route sensitive group approvals privately * fix(commands): require owner private routes * test(commands): cover owner-derived Telegram diagnostics routing
This follows up on the diagnostics and trajectory export approval work. The previous behavior kept sensitive group commands private only when the originating surface could resolve a private owner route. That meant a Discord group invocation could fail even when the owner already had Telegram configured as their primary private interface.
This change makes the private route resolver match the expected owner ergonomics: try the same surface first, then fall back to the first available owner route from commands.ownerAllowFrom. The command handlers then use exactly that selected route for both the exec approval defaults and the final private reply, so group chats only get the short acknowledgement while the sensitive details land in the owner DM.
The resolver now also treats owner identity as a hard boundary, not just a ranking hint. Native approval clients may know about exec approvers who are not command owners, so those targets are filtered out before routing diagnostics or trajectory details.
The tests cover the ordering rule directly, the non-owner exec approver regression, and /diagnostics plus /export-trajectory using only the selected private target for approval/result delivery.