reject backslash-after-scheme urls in is_safe_url - #70215
Merged
Conversation
Samin061
requested review from
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
jason810496,
pierrejeambrun,
rawwar and
shubhamraj-git
as code owners
July 22, 2026 06:43
Contributor
Backport successfully created: v3-3-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
github-actions Bot
pushed a commit
to aws-mwaa/upstream-to-airflow
that referenced
this pull request
Jul 27, 2026
aws-airflow-bot
pushed a commit
to aws-mwaa/upstream-to-airflow
that referenced
this pull request
Jul 27, 2026
pierrejeambrun
pushed a commit
that referenced
this pull request
Jul 27, 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.
is_safe_urlinairflow-core/src/airflow/api_fastapi/core_api/security.pyrejects a leading//,/\,\/and\\, but not a backslash that follows the scheme, sohttps:\\evil.comis parsed by urllib as a relative path,urljoinre-attaches the base netloc, and the netloc comparison passes. Browsers follow WHATWG, where\is/for special schemes, so the same string navigates tohttps://evil.com—GET /auth/token/login?next=https:\\evil.comreturns it verbatim as the redirect location andGET /auth/login?next=forwards it to the auth manager login page, both without authentication. Normalising backslashes to forward slashes before the prefix check and the parse makes the helper agree with the parser that actually resolves the value; the secondunquotegoes away with it so the guard and the resolution look at the same string.Was generative AI tooling used to co-author this PR?