[security] fix(slack): preserve per-user session isolation for slash commands in shared channels#9361
Conversation
|
Thanks for linking this. I rechecked the current PR against #10875 and did not make a code change here: this branch is still intentionally scoped to the cross-user isolation issue for Slack slash commands in shared channels, while #10875 carries the broader session-scope/thread-context fix. Validation on the current head (
|
|
Thanks for flagging this. I checked the overlap with #10875 and I agree they are related but not duplicate:
Keeping this PR scoped to the cross-user isolation boundary should make it safe to review/merge independently while #10875 handles the broader session-key behavior. |
|
Merged via PR #18553. Your commit was cherry-picked onto current main with your authorship preserved (rebase merge). Thanks for the contribution! 🎉 |
Adds email→username mappings for: - priveperfumes (PR NousResearch#18456) - amroessam (PR NousResearch#17798) - Hinotoi-agent (PR NousResearch#9361) - valda (PR NousResearch#14932)
Adds email→username mappings for: - priveperfumes (PR NousResearch#18456) - amroessam (PR NousResearch#17798) - Hinotoi-agent (PR NousResearch#9361) - valda (PR NousResearch#14932)
Summary
This PR fixes a Slack session-isolation issue affecting slash commands in shared channels.
Before this change,
/hermesslash commands invoked by different users in the same Slack channel could resolve to the same session key. That allowed cross-user session/context bleed and could cause one user to inherit or affect another user’s active conversation state.This patch preserves per-user isolation for shared-channel slash commands and adds regression coverage to lock in the expected behavior.
Security impact
Issue:
Slack slash-command session collision in shared channels
Impact:
Cross-user context bleed and session manipulation
CVSS v3.1:
8.3 High
Vector:
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:LProblem
Slack slash commands currently construct their session source using DM-style semantics even when invoked from a shared channel.
Because DM session keys do not include
user_id, two different users running/hermesin the same channel can land in the same session.This can cause:
Root cause
In
gateway/platforms/slack.py, slash-command handling forced channel slash commands into DM semantics.In
gateway/session.py, DM session keys are keyed by channel/thread and do not include user identity.Together, this allowed different users in the same Slack channel to collide into the same session.
Fix
This PR updates Slack slash-command session construction so shared-channel slash commands preserve per-user isolation instead of forcing DM session semantics.
Example
Before
After
Files changed
gateway/platforms/slack.pytests/gateway/test_slack.pyTest plan
/hermesin the same shared channelsource venv/bin/activate && python -m pytest tests/gateway/test_slack.py -qScope
This is a narrow fix limited to Slack slash-command session handling in shared channels. It does not change normal DM behavior or unrelated gateway logic.