Repository navigation
gh-161569: Check cookie policy before deleting expired cookies in http.cookiejar - #161570
Merged
Eclips4 merged 1 commit intoNov 7, 2026
Merged
Conversation
…in http.cookiejar An expired Set-Cookie header was allowed to delete a stored cookie using the Domain and Path attributes taken verbatim from the header, before CookiePolicy.set_ok() was consulted. A response from one host could therefore delete cookies belonging to any other domain in a shared jar. The policy is now consulted before an expired cookie may delete an existing one, as required by RFC 6265 section 5.3. Co-authored-by: Victor Stinner <vstinner@python.org>
|
Thanks @Eclips4 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12, 3.13, 3.14, 3.15. |
|
GH-161579 is a backport of this pull request to the 3.15 branch. |
|
GH-161580 is a backport of this pull request to the 3.14 branch. |
|
GH-161581 is a backport of this pull request to the 3.13 branch. |
|
GH-161582 is a backport of this pull request to the 3.12 branch. |
|
GH-161583 is a backport of this pull request to the 3.11 branch. |
Eclips4
added a commit
that referenced
this pull request
Nov 7, 2026
… in `http.cookiejar` (GH-161570) (#161579) gh-161569: Check cookie policy before deleting expired cookies in `http.cookiejar` (GH-161570) gh-161569: Check cookie policy before deleting expired cookies in http.cookiejar An expired Set-Cookie header was allowed to delete a stored cookie using the Domain and Path attributes taken verbatim from the header, before CookiePolicy.set_ok() was consulted. A response from one host could therefore delete cookies belonging to any other domain in a shared jar. The policy is now consulted before an expired cookie may delete an existing one, as required by RFC 6265 section 5.3. (cherry picked from commit 8eb3d2c) Co-authored-by: Kirill Podoprigora <kirill.bast@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
Eclips4
added a commit
that referenced
this pull request
Nov 7, 2026
… in `http.cookiejar` (GH-161570) (#161580) gh-161569: Check cookie policy before deleting expired cookies in `http.cookiejar` (GH-161570) gh-161569: Check cookie policy before deleting expired cookies in http.cookiejar An expired Set-Cookie header was allowed to delete a stored cookie using the Domain and Path attributes taken verbatim from the header, before CookiePolicy.set_ok() was consulted. A response from one host could therefore delete cookies belonging to any other domain in a shared jar. The policy is now consulted before an expired cookie may delete an existing one, as required by RFC 6265 section 5.3. (cherry picked from commit 8eb3d2c) Co-authored-by: Kirill Podoprigora <kirill.bast@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
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.
http.cookiejardeletes cookies of other domains via expired Set-Cookie [CVE-2026-124249] #161569