Fix potential vulnerability in cloned function#12
Open
navnitan-7 wants to merge 1 commit intoring04h:masterfrom
Open
Fix potential vulnerability in cloned function#12navnitan-7 wants to merge 1 commit intoring04h:masterfrom
navnitan-7 wants to merge 1 commit intoring04h:masterfrom
Conversation
Made-with: Cursor
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.
Summary
This PR fixes a potential security vulnerability in
rebuild_auth()inlibs/requests/sessions.pythat was cloned from python-requests but did not receive the security patch for CVE-2018-18074.Details
Affected Function:
rebuild_auth()inlibs/requests/sessions.pyOriginal Fix: requests/requests@be32cb8
Changes
Added a scheme-downgrade check so the
Authorizationheader is stripped not only when the redirect target is a different host, but also when the redirect downgrades from HTTPS to HTTP. Previously, credentials could leak in plaintext when a server redirected an HTTPS request to an HTTP endpoint on the same host.Impact
Without this fix, an attacker controlling a redirect target could force a scheme downgrade to capture the
Authorizationheader over an unencrypted connection.References