potiuk opened a new pull request, #72646:
URL: https://github.com/apache/airflow/pull/72646

   Akeyless secret names are built by joining `<base path><sep><key>`, and the
   key was not validated.
   
   In multi-team mode the team-scoped lookup is tried first and, when it misses,
   the team-agnostic fallback resolves `<base path><sep><key>` — which is the
   prefix every *other* team's secrets are stored under. A caller in team 
`alpha`
   requesting the key `beta/db_password` therefore reached team `beta`'s secret.
   The key is Dag-author controlled and the execution API variables route is
   declared with a `:path` converter, so a separator survives the round trip.
   
   ### Scope of the refusal
   
   The separator here is the ordinary path separator and nested keys are a
   documented layout, so the refusal is kept as narrow as the defect — it 
applies
   only where this backend actually crosses a namespace (multi-team on,
   team-scoped paths in use, and a team name supplied):
   
   * `use_team_secrets_path=False` builds no team path, so nothing is refused 
and
     a flat nested layout keeps working under multi-team mode.
   * `get_config()` takes no team name, and Airflow does not perform team-scoped
     config lookups through a secrets backend, so that path has no boundary to
     cross and is not guarded. Subfolder config layouts keep resolving.
   * A caller with no team name resolves in the shared namespace directly rather
     than falling back into it.
   
   The key is never parsed to determine *which* team it names, because it cannot
   be — nothing distinguishes a nested key in the shared namespace from one
   naming another team.
   
   ### Also in this change
   
   `core.multi_team` is now read with `getboolean`. It was read with `conf.get`,
   which returns the string `"False"` — truthy — so the multi-team branches were
   selected even with multi-team disabled.
   
   ### Tests
   
   The escape tests wire the backend so the cross-team path *would* return a
   value, and assert that it does not come back — rather than asserting that a
   guard ran. Against unpatched sources they fail with
   `assert 'beta-secret' is None`.
   
   Compatibility is covered too: nested config ids under multi-team, nested keys
   with `use_team_secrets_path=False`, nested keys for a caller with no team, 
and
   ordinary team-scoped lookups.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to