Skip to content

fix: Add access control for private Slack channel search#786

Merged
bokelley merged 1 commit into
mainfrom
bokelley/fix-addie-msg-count
Jan 16, 2026
Merged

fix: Add access control for private Slack channel search#786
bokelley merged 1 commit into
mainfrom
bokelley/fix-addie-msg-count

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Fix Addie's channel activity query to use actual Slack timestamps (slack_ts) instead of database record creation time (created_at)
  • Remove aao-admin from the exclusion list so it can be indexed
  • Add access control for private Slack channels based on working group membership
  • Only index private channels that have linked working groups (simplifies access control)
  • Filter search results to only show channels the user has access to

Security

This PR addresses a potential information leak where users could search for keywords and receive results from private channels they don't have access to.

Private channel access is now determined by:

  1. Working group membership - only private channels with linked working groups are indexed
  2. Local database lookup - fast membership checks without Slack API calls

Test plan

  • TypeScript compiles
  • All unit tests pass
  • Homepage loads in browser (Vibium test)
  • Manual test: search for content in a private channel as a non-member (should not return results)
  • Manual test: search for content in a private channel as a member (should return results)

🤖 Generated with Claude Code

- Fix channel activity query to use slack_ts instead of created_at
- Remove aao-admin from exclusion list (was blocking indexing)
- Add access control for private channels based on working group membership
- Filter search results to only show channels user has access to
- Only index private channels that have linked working groups
- Add getAccessiblePrivateChannelIds for efficient membership lookup
- Add getWorkingGroupIdsByUser for local membership queries

This ensures users can only see search results from:
1. Public channels (accessible to all workspace members)
2. Private channels where they are a working group member

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bokelley bokelley merged commit 3b5f48d into main Jan 16, 2026
6 checks passed
bokelley added a commit that referenced this pull request Jan 16, 2026
- Fix channel activity query to use slack_ts instead of created_at
- Remove aao-admin from exclusion list (was blocking indexing)
- Add access control for private channels based on working group membership
- Filter search results to only show channels user has access to
- Only index private channels that have linked working groups
- Add getAccessiblePrivateChannelIds for efficient membership lookup
- Add getWorkingGroupIdsByUser for local membership queries

This ensures users can only see search results from:
1. Public channels (accessible to all workspace members)
2. Private channels where they are a working group member

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
bokelley added a commit that referenced this pull request Jan 20, 2026
- Fix channel activity query to use slack_ts instead of created_at
- Remove aao-admin from exclusion list (was blocking indexing)
- Add access control for private channels based on working group membership
- Filter search results to only show channels user has access to
- Only index private channels that have linked working groups
- Add getAccessiblePrivateChannelIds for efficient membership lookup
- Add getWorkingGroupIdsByUser for local membership queries

This ensures users can only see search results from:
1. Public channels (accessible to all workspace members)
2. Private channels where they are a working group member

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant