CVE-2023-45803: Request body not stripped after redirect in urllib3

Published Oct 17, 2023
·
Updated

A flaw found in the urllib3. The urllib3 is a user-friendly HTTP client library for Python. urllib3 previously wouldn't remove the HTTP request body when an HTTP redirect response using status 301, 302, or 303 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 this behavior 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. Because the vulnerability requires a previously trusted service to become compromised in order to have an impact on confidentiality we believe the exploitability of this vulnerability is low. Additionally, many users aren't putting sensitive data in HTTP request bodies, if this is the case then this vulnerability isn't exploitable. Both of the following conditions must be true to be affected by this vulnerability: 1. Using urllib3 and submitting sensitive information in the HTTP request body (such as form data or JSON) and 2. The origin service is compromised and starts redirecting using 301, 302, or 303 to a malicious peer or the redirected-to service becomes compromised. This issue has been addressed in versions 1.26.18 and 2.0.7 and users are advised to update to resolve this issue. Users unable to update should disable redirects for services that aren't expecting to respond with redirects with redirects=False and disable automatic redirects with redirects=False and handle 301, 302, and 303 redirects manually by stripping the HTTP request body.

References: https://github.com/urllib3/urllib3/security/advisories/GHSA-g4mx-q9vg-27p4 https://www.rfc-editor.org/rfc/rfc9110.html#name-get https://github.com/urllib3/urllib3/commit/4e98d57809dacab1cbe625fddeec1a290c478ea9

Other sources

Request body not stripped after redirect in urllib3

Microsoft

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.

Affected usages

Because the vulnerability requires a previously trusted service to become compromised in order to have an impact on confidentiality we believe the exploitability of this vulnerability is low. Additionally, many users aren't putting sensitive data in HTTP request bodies, if this is the case then this vulnerability isn't exploitable.

Both of the following conditions must be true to be affected by this vulnerability:

If you're using urllib3 and submitting sensitive information in the HTTP request body (such as form data or JSON) The origin service is compromised and starts redirecting using 303 to a malicious peer or the redirected-to service becomes compromised.

Remediation

You can remediate this vulnerability with any of the following steps:

Upgrade to a patched version of urllib3 (v1.26.18 or v2.0.7) Disable redirects for services that you aren't expecting to respond with redirects with redirects=False. Disable automatic redirects with redirects=False and handle 303 redirects manually by stripping the HTTP request body.

GitHub

Affected Software

17 affected componentsFixes available
pip/urllib3>=0<1.26.18
1.26.18
pip/urllib3>=2.0.0<2.0.7
2.0.7
Python urllib3<1.26.18
Python urllib3>=2.0.0<2.0.7
Fedoraproject Fedora=38
redhat/urllib3<2.0.7
2.0.7
IBM Business Automation Insights<=25.0.0
IBM Business Automation Insights<=24.0.1
IBM Business Automation Insights<=24.0.0
Microsoft azl3 python-urllib3 2.0.7-1
Microsoft azl3 python-pip 24.2-1
Microsoft cbl2 python-urllib3 1.26.18-1
Microsoft cbl2 python3 3.9.19-13
Microsoft cbl2 python-virtualenv 20.26.6-1
Microsoft azl3 python-pip 24.0-2
Microsoft azl3 python-urllib3 2.0.4-1
Microsoft cbl2 python-virtualenv 20.26.6-1

Event History

Oct 17, 2023
CVE Published
via MITRE·07:43 PM
Data Sourced
via MITRE·07:43 PM
DescriptionSeverityWeakness
Data Sourced
08:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Advisory Published
via GitHub·08:15 PM
Oct 23, 2023
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
SeverityAffected Software
Updated
via Microsoft·07:00 AM
DescriptionSeverity
Oct 29, 2023
Data Sourced
via Red Hat·02:46 PM
DescriptionSeverityAffected Software
Nov 3, 2025
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2023-45803?

CVE-2023-45803 is a vulnerability in urllib3 that allows an HTTP request body to remain after a method change to `GET` in a redirect response.

2

What is the severity of CVE-2023-45803?

The severity of CVE-2023-45803 is medium with a CVSS score of 4.2.

3

How does CVE-2023-45803 affect the urllib3 package?

CVE-2023-45803 affects urllib3 package versions 1.26.17 and earlier and versions 2.0.0 to 2.0.6. It has been fixed in version 1.26.18 and 2.0.7.

4

How can I fix CVE-2023-45803?

To fix CVE-2023-45803, update the urllib3 package to version 1.26.18 or 2.0.7 using pip.

5

Where can I find more information about CVE-2023-45803?

More information about CVE-2023-45803 can be found in the advisory and commits on the urllib3 GitHub repository: - Advisory: [here](https://github.com/urllib3/urllib3/security/advisories/GHSA-g4mx-q9vg-27p4) - Commit 1: [here](https://github.com/urllib3/urllib3/commit/4e50fbc5db74e32cabd5ccc1ab81fc103adfe0b3) - Commit 2: [here](https://github.com/urllib3/urllib3/commit/b594c5ceaca38e1ac215f916538fb128e3526a36)

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203