Skip to content

Restrict asset state store access to registered tasks#69764

Open
fat-catTW wants to merge 1 commit into
apache:mainfrom
fat-catTW:enforce-asset-state-store-registration
Open

Restrict asset state store access to registered tasks#69764
fat-catTW wants to merge 1 commit into
apache:mainfrom
fat-catTW:enforce-asset-state-store-registration

Conversation

@fat-catTW

Copy link
Copy Markdown
Contributor

Why:

Asset state store entries are scoped to assets, but execution API task tokens should not be able to access every active asset.

Previously, any task with a valid execution token could read or mutate state for unrelated assets. This made asset state store access broader than the task's declared asset relationships.

Solution:

Restrict the execution API asset state store routes so task tokens can only access assets registered to that task as an inlet or outlet.

The routes now check TaskInletAssetReference and TaskOutletAssetReference before allowing GET, PUT, DELETE, or CLEAR operations. Unregistered task access returns 403 Forbidden.

Watcher writes keep using the existing non-task path because watcher tokens are not backed by task instances.

Tests cover forbidden access for unregistered tasks and allowed access for inlet/outlet-registered tasks.

Was generative AI tooling used to co-author this PR?
  • [X] Yes (please specify the tool below)

Generated-by: [Codex] following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:task-sdk labels Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:task-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant