CVE-2023-45803: urllib3's request body not stripped after redirect from 303 status changes request method to GET
(updated )
urllib3 previously wouldn’t remove the HTTP request body when an HTTP redirect response using status 303 “See Other” after the request had its method changed from one that could accept a request body (like POST
) to GET
as is required by HTTP RFCs. Although the behavior of removing the request body is not specified in the section for redirects, it can be inferred by piecing together information from different sections and we have observed the behavior in other major HTTP client implementations like curl and web browsers.
From RFC 9110 Section 9.3.1:
A client SHOULD NOT generate content in a GET request unless it is made directly to an origin server that has previously indicated, in or out of band, that such a request has a purpose and will be adequately supported.
References
- github.com/advisories/GHSA-g4mx-q9vg-27p4
- github.com/pypa/advisory-database/tree/main/vulns/urllib3/PYSEC-2023-212.yaml
- github.com/urllib3/urllib3
- github.com/urllib3/urllib3/commit/4e50fbc5db74e32cabd5ccc1ab81fc103adfe0b3
- github.com/urllib3/urllib3/commit/4e98d57809dacab1cbe625fddeec1a290c478ea9
- github.com/urllib3/urllib3/commit/b594c5ceaca38e1ac215f916538fb128e3526a36
- github.com/urllib3/urllib3/releases/tag/1.26.18
- github.com/urllib3/urllib3/releases/tag/2.0.7
- github.com/urllib3/urllib3/security/advisories/GHSA-g4mx-q9vg-27p4
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4R2Y5XK3WALSR3FNAGN7JBYV2B343ZKB
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/5F5CUBAN5XMEBVBZPHFITBLMJV5FIJJ5
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PPDPLM6UUMN55ESPQWJFLLIZY4ZKCNRX
- nvd.nist.gov/vuln/detail/CVE-2023-45803
- www.rfc-editor.org/rfc/rfc9110.html
Detect and mitigate CVE-2023-45803 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →