Skip to content

fix: gate team provider reads on team visibility - #100

Open
atbagan wants to merge 1 commit into
mainfrom
fix/team-providers-read-authz
Open

atbagan wants to merge 1 commit into
mainfrom
fix/team-providers-read-authz

Conversation

@atbagan

@atbagan atbagan commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

What

GET /teams/{name}/providers filtered providers by scope but never checked who was asking. Any authenticated user could enumerate another team's team-scoped providers by naming that team in the path.

Proof

Probed on the development estate with a team admin of platform-engineering who is not a member of e2e-other-team:

  • GET /teams/e2e-other-team/providers answered 200 and listed the provider scoped to e2e-other-team.

The mutations on the same route (POST, DELETE) already gate on CanOperateTeam.

Change

  • The read now requires CanViewTeam: every team member and any platform role still reads it; a non-member gets 403 with the same wording the mutations use.
  • The scope filter is extracted as providersVisibleToTeam and covered by table tests (platform, unscoped default, own team, other team, team scope without a ref).

No behaviour change for callers who could legitimately read the list.

🤖 Generated with Claude Code

https://claude.ai/code/session_01APpgCYzvB1vEntdFm3py2n

GET /teams/{name}/providers filtered by scope but never checked who was
asking, so any authenticated user could enumerate another team's
team-scoped providers by naming that team in the path. The scope exists
to keep those providers to their team; the read undid that.

The read now requires CanViewTeam, the weaker of the two team checks, so
every member of the team and any platform role still sees what the team
may use, while a non-member is refused the way the mutations on the same
route already refuse them. The scope filter is extracted and tested on
its own.
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