Skip to content

fix(api): enforce secret-project visibility in search and analytics - #412

Merged
martian56 merged 2 commits into
mainfrom
fix/workspace-search-analytics-visibility
Nov 14, 2026
Merged

martian56 merged 2 commits into
mainfrom
fix/workspace-search-analytics-visibility

Conversation

@martian56

Copy link
Copy Markdown
Member

Summary

Workspace search, workspace analytics (incl. trend) and the analytics CSV export only checked workspace membership, so a plain member could read titles, states, labels and assignee emails from secret projects they don't belong to.

  • New store.ProjectVisibility predicate (same rule as ListVisibleByWorkspaceID: public projects + projects the caller belongs to; workspace admins/owners see all), applied to every search group (issues, epics, cycles, modules, views, pages, projects) and every workspace analytics/export query.
  • Per-project analytics + CSV export now go through enforceProjectVisibility and verify the project belongs to the workspace in the URL.
  • Regression tests in secret_project_visibility_test.go cover outsider (hidden), project member and workspace admin (visible).

Note: GET /projects/:id/analytics/ still 500s due to a pre-existing broken query (selects a non-existent state column); unrelated to access control.

AI assistance

  • Claude Code (Claude Opus 5.5) helped write this change.

🤖 Generated with Claude Code

Workspace search, workspace analytics (incl. trend) and the analytics CSV
export filtered only by workspace membership, so plain members could read
titles, labels, states and assignee emails of secret projects they don't
belong to. Apply the same visibility rule used by the project list
(public, or a project the caller is a member of; admins see all) at the
store layer, and gate per-project analytics through
enforceProjectVisibility while also checking the project belongs to the
workspace in the URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@martian56
martian56 requested a review from a team as a code owner November 14, 2026 21:26
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 25d29dd6-1871-4660-9c0a-3c4fbf652dea
Commits

Reviewing files that changed from the base of the PR and between 07daa29 and b2a7419.

Files selected for processing: 8

  • apps/api/internal/handler/analytics.go
  • apps/api/internal/handler/secret_project_visibility_test.go
  • apps/api/internal/service/access.go
  • apps/api/internal/service/analytics.go
  • apps/api/internal/service/search.go
  • apps/api/internal/store/analytics.go
  • apps/api/internal/store/search.go
  • apps/api/internal/store/visibility.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Review follow-up: workspace search returned private pages (access=1) to
users other than their owner; apply the same owner-only rule the page
service uses. Move projectVisibilityFor above enforceProjectVisibility's
doc comment, and add tests for private pages and for members whose
project membership was removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@martian56
martian56 merged commit c5007b3 into main Nov 14, 2026
8 checks passed
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