Skip to content

[v3-3-test] Prevent Dag-existence disclosure on partitioned dag runs … - #72660

Merged
potiuk merged 1 commit into
apache:v3-3-testfrom
potiuk:backport-5c40e73-v3-3-test
Sep 7, 2026
Merged

potiuk merged 1 commit into
apache:v3-3-testfrom
potiuk:backport-5c40e73-v3-3-test

Conversation

@potiuk

@potiuk potiuk commented Sep 7, 2026

Copy link
Copy Markdown
Member

…listing (#72640)

  • Prevent Dag-existence disclosure on partitioned dag runs listing

The empty-results branch of the /ui/partitioned_dag_runs listing raised 404 when a Dag did not exist, but returned 200-empty when a Dag existed but was outside the caller's permitted set (the readable-dags row filter had already dropped its rows). A caller could therefore probe by dag_id and learn which identifiers exist beyond what they are allowed to read.

Scope the existence probe to readable Dags so the two cases collapse to the same 404, matching the "so their existence does not leak either" idiom used by PermittedEventLogFilter / PermittedAssetEventFilter. Behavior is unchanged for callers with full Dag access.

  • Simplify existence check and strengthen leak-regression test

readable_dag_ids already comes from DagModel in both in-tree auth managers, so membership in the set proves existence — the extra DagModel round-trip and IN list is only useful for the admin path, where no filter is active.

Add an AssetPartitionDagRun for the unreadable Dag in the regression test so the readable-dags row filter is what drops the rows, matching the scenario the docstring describes.

  • Declare 404 response on the partitioned dag runs listing

The listing raises HTTPException(404) when a dag_id filter targets a Dag the caller cannot see, but the route did not declare 404 in its OpenAPI responses. Clients generated from the spec therefore treated 404 as an unexpected transport error rather than a documented outcome, and the API docs page did not surface it.

  • Tighten comment on the existence-check branch (cherry picked from commit 5c40e73)

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

  • 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.

…listing (apache#72640)

* Prevent Dag-existence disclosure on partitioned dag runs listing

The empty-results branch of the /ui/partitioned_dag_runs listing raised 404
when a Dag did not exist, but returned 200-empty when a Dag existed but was
outside the caller's permitted set (the readable-dags row filter had already
dropped its rows). A caller could therefore probe by dag_id and learn which
identifiers exist beyond what they are allowed to read.

Scope the existence probe to readable Dags so the two cases collapse to the
same 404, matching the "so their existence does not leak either" idiom used
by PermittedEventLogFilter / PermittedAssetEventFilter. Behavior is unchanged
for callers with full Dag access.

* Simplify existence check and strengthen leak-regression test

readable_dag_ids already comes from DagModel in both in-tree auth managers,
so membership in the set proves existence — the extra DagModel round-trip
and IN list is only useful for the admin path, where no filter is active.

Add an AssetPartitionDagRun for the unreadable Dag in the regression test
so the readable-dags row filter is what drops the rows, matching the
scenario the docstring describes.

* Declare 404 response on the partitioned dag runs listing

The listing raises HTTPException(404) when a dag_id filter targets a Dag the
caller cannot see, but the route did not declare 404 in its OpenAPI
responses. Clients generated from the spec therefore treated 404 as an
unexpected transport error rather than a documented outcome, and the API
docs page did not surface it.

* Tighten comment on the existence-check branch
(cherry picked from commit 5c40e73)

Co-authored-by: Pierre Jeambrun <[email protected]>
@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. labels Sep 7, 2026
@potiuk
potiuk merged commit 8800b6d into apache:v3-3-test Sep 7, 2026
87 checks passed
@potiuk
potiuk deleted the backport-5c40e73-v3-3-test branch September 7, 2026 19:46
@github-actions github-actions Bot added this to the Airflow 3.3.2 milestone Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Hi maintainer, this PR was merged without a milestone set.
We've automatically set the milestone to Airflow 3.3.2 based on: merged to version branch
If this milestone is not correct, please update it to the appropriate milestone.

This comment was generated by Milestone Tag Assistant.

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:UI Related to UI/UX. For Frontend Developers. type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants