Skip to content

Restrict MSGraph pagination nextLink to the configured host#69742

Merged
dabla merged 4 commits into
apache:mainfrom
Samin061:msgraph-nextlink-host-check
Jul 13, 2026
Merged

Restrict MSGraph pagination nextLink to the configured host#69742
dabla merged 4 commits into
apache:mainfrom
Samin061:msgraph-nextlink-host-check

Conversation

@Samin061

Copy link
Copy Markdown
Contributor

paginated_run follows the @odata.nextLink from each Microsoft Graph response and refetches it with the connection's bearer token attached, while Kiota's allowed_hosts defaults to empty (any host) when no authority is set, so a tampered response can send the token to an arbitrary host. Pin follow-up pagination requests to the configured endpoint's host and refuse a nextLink that points elsewhere.

Comment thread providers/microsoft/azure/src/airflow/providers/microsoft/azure/hooks/msgraph.py Outdated
Signed-off-by: bibi samina <sam@bugqore.com>
@potiuk

potiuk commented Jul 11, 2026

Copy link
Copy Markdown
Member

@Samin061 — Some review feedback from @dabla is waiting on you: 1 unresolved review thread(s). Could you either push a fix or reply in each thread explaining why the feedback doesn't apply? When you believe the feedback is addressed, please mark the threads as resolved and ping the reviewer (@dabla) for a final look. Thanks!


Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you.

Comment thread providers/microsoft/azure/src/airflow/providers/microsoft/azure/hooks/msgraph.py Outdated
Comment thread providers/microsoft/azure/src/airflow/providers/microsoft/azure/hooks/msgraph.py Outdated
Comment thread providers/microsoft/azure/src/airflow/providers/microsoft/azure/hooks/msgraph.py Outdated
Signed-off-by: bibi samina <sam@bugqore.com>
@Samin061

Copy link
Copy Markdown
Contributor Author

Pushed the refactor: allowed_netloc is resolved once from the request adapter's base_url in get_async_conn and stored on self (init to None in init), so there are no per-run connection lookups anymore. Also updated the adapter mocks in the tests that go through get_async_conn to carry a real base_url. All threads addressed and resolved. @dabla ready for another look when you have a moment.

@dabla dabla changed the title restrict msgraph pagination nextLink to the configured host Restrict MSGraph pagination nextLink to the configured host Jul 13, 2026
@dabla
dabla merged commit 5de1b18 into apache:main Jul 13, 2026
83 checks passed
@dabla

dabla commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Well done @Samin061 , the PR has been merged!

@Samin061

Samin061 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

thankyou @dabla for taking time to review, will be looking forward to work more on this repo . thanks againn

joshuabvarghese pushed a commit to joshuabvarghese/airflow that referenced this pull request Jul 16, 2026
…9742)

* restrict msgraph pagination nextLink to the configured host

* Compute pagination host check inside the run loop

* Resolve pagination host once when building the request adapter

Signed-off-by: bibi samina <sam@bugqore.com>

---------

Signed-off-by: bibi samina <sam@bugqore.com>
Co-authored-by: David Blain <info@dabla.be>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants