`http.cookiejar` applies expired `Set-Cookie` to cookie store before policy validation
- State
- Published
- Severity
- 6.3 Medium
- Published
- Nov 9, 2026
- Updated
- Nov 12, 2026
- Reserved
- Nov 7, 2026
Description
http.cookiejar.CookieJar deleted a stored cookie when a response carried an already expired Set-Cookie header for it, using the Domain and Path attributes from the header without consulting the cookie policy. A server could therefore delete cookies belonging to other domains from a shared cookie jar, such as the one used by urllib's HTTPCookieProcessor. The fix consults the cookie policy before an expired cookie may delete an existing one, as required by RFC 6265 section 5.3.
| Product | Versions |
|---|---|
| CPython Python Software Foundation | before 3.16.0a2 Affected |
| CVSS | Score | How It's Reached | Source |
|---|---|---|---|
| 4.0 | 6.3 Medium | PSF |
Weaknesses
References
- https://github.com/python/cpython/pull/161570Patch
- https://github.com/python/cpython/issues/161569Issue Tracker
- https://mail.python.org/archives/list/security-announce@python.org/thread/Y6IKNZ2VZUS2L6CLQICSFUEMCLT7OLTY/Vendor Advisory
- https://github.com/python/cpython/commit/4e9d037f1cfc8e29efcb1f67bc668e06ff2b6643Patch
- https://github.com/python/cpython/commit/8eb3d2c1c41ca7ce628554413981c1eb763a1494Patch
- https://github.com/python/cpython/commit/ac1d49f4fbb33941475c5aa3cb663ab39d64cb73Patch
- http://www.openwall.com/lists/oss-security/2026/11/09/24
Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.