service: guard against cross-origin __next URL redirection#308
Open
phanak-sap wants to merge 1 commit into
Open
service: guard against cross-origin __next URL redirection#308phanak-sap wants to merge 1 commit into
phanak-sap wants to merge 1 commit into
Conversation
Contributor
Author
|
Build will currently fail because PR #307 not yet merged. Important should be passing of both newly added tests (passing localy)
|
filak-sap
requested changes
Jul 10, 2026
filak-sap
left a comment
Contributor
There was a problem hiding this comment.
Just do not open PRs if you know that tests are failing and another fixing the tests is pending please! Now merge the tests fixing PR and rebase this one.
OData servers can legitimately paginate across path segments, but the __next value is server-controlled and untrusted. Validate that its origin (scheme + host + port) matches the configured service root before dispatching, so session-level credentials are never forwarded to a host the application did not configure. Raises PyODataException on mismatch. Fix is applied in ODataHttpRequest._build_request(), the single point both execute() (sync) and async_execute() (async) pass through, so one check covers all dispatch paths. Depends on stdlib urllib.parse only, keeping pyodata networking-library agnostic.
0cf200d to
2bbf7b4
Compare
Contributor
Author
sure, that was indeed the intended path forward for me. |
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.
OData servers can legitimately paginate across path segments, but the
__next value is server-controlled and untrusted. Validate that its origin
(scheme + host + port) matches the configured service root before
dispatching, so session-level credentials are never forwarded to a host
the application did not configure. Raises PyODataException on mismatch.
Fix is applied in ODataHttpRequest._build_request(), the single point
both execute() (sync) and async_execute() (async) pass through, so one
check covers all dispatch paths. Depends on stdlib urllib.parse only,
keeping pyodata networking-library agnostic.