Refuse the team agnostic fall-through for a team scoped Lockbox secret name - #70877
Merged
Miretpl merged 2 commits intoAug 1, 2026
Merged
Conversation
…t name The team scoped lookup is tried first and then, on a miss, the lookup falls through to the team agnostic name. A guard was meant to stop a caller naming another team's secret, but its first condition is `team_name is None`, so it does nothing whenever a team scope is supplied -- exactly when it matters. A caller authorised for one team could therefore supply an id that spells out another team's namespace and resolve that team's secret. Refuse the fall-through instead. The team scoped lookup still runs first and is safe by construction, since it can only ever build the caller's own namespace. After it misses, an id that spells out any team namespace is refused rather than resolved through the team agnostic name. The id is never parsed to work out which team it names, because it cannot be: a team name may itself contain the separator, so nothing distinguishes one team's namespace from another whose name extends it. Comparing the id against the prefix the caller's own team builds looks equivalent and is not -- a caller in team `a` matches `a--b`'s namespace on the prefix and would read its secrets. Generated-by: Claude Opus 5 (1M context) following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
Refusing only the team agnostic fall-through left the team scoped lookup open to the same ambiguity it was meant to close: a caller in team 'a' asking for 'b//c' builds exactly the name team 'a//b' builds for 'c', and that lookup runs first, so the fall-through is never reached. Deciding this at the entry points instead means the ambiguity is settled before a name is built, and the refusal is logged so the resulting None is not read as a missing secret.
Miretpl
approved these changes
Aug 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The team scoped lookup runs first and, on a miss, falls through to the team
agnostic name. A guard was meant to stop a caller naming another team's secret:
Its first condition is
team_name is None, so it does nothing whenever a teamscope is supplied — exactly when it matters. A caller authorised for one team
could supply an id spelling out another team's namespace; the team scoped probe
missed, and the team agnostic lookup resolved the other team's secret.
Approach
ever build the caller's own namespace;
than resolved through the team agnostic name;
The id is never parsed to work out which team it names, because it cannot be:
a team name may itself contain the separator, so nothing in the string
distinguishes one team's namespace from another whose name extends it. Comparing
the id against the prefix the caller's own team builds looks equivalent and is
not — a caller in team
amatchesa--b's namespace on the prefix and would readits secrets. Only the caller's own namespace is ever constructed, never parsed.
Behaviour change
An id that spells out a team scoped name is no longer resolvable through the team
agnostic name from any scope, including the team that owns it — that spelling is
what made a prefix match look like ownership. Callers reach their own team's
secrets with the bare id plus their team scope, which is unaffected, as are
single-team and non-team deployments.
Test plan
naming it, and a team whose name extends the caller's (
teama--prodvsteama) is not reachable eitherresolvable in the fixture, so a backend that falls through returns its value
ruff check/ruff formatcleanWas generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 5 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions