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

16 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
Microsoft azl3 python-urllib3 2.0.7-1
Microsoft azl3 python-pip 24.2-1
Microsoft cbl2 python3 3.9.19-13
Microsoft cbl2 python-urllib3 1.26.18-1
Microsoft azl3 python-pip 24.0-2
Microsoft cbl2 python-virtualenv 20.26.6-1
Microsoft azl3 python-urllib3 2.0.4-1
Microsoft cbl2 python-virtualenv 20.26.6-1
redhat/urllib3<2.0.7
2.0.7
IBM Db2 Genius Hub<=1.1, 1.1.1, 1.1.2
IBM Agentics<=1.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/urllib3 to a version that resolves this vulnerability.

    Fixed in 1.26.18
  2. Upgrade

    Upgrade pip/urllib3 to a version that resolves this vulnerability.

    Fixed in 2.0.7
  3. Upgrade

    Upgrade redhat/urllib3 to a version that resolves this vulnerability.

    Fixed in 2.0.7
  4. Upgrade

    Upgrade urllib3 to a version that resolves this vulnerability.

    Fixed in 1.26.18
  5. Upgrade

    Upgrade urllib3 to a version that resolves this vulnerability.

    Fixed in 2.0.7
  6. Configuration

    Set urllib3's redirects parameter to redirects=False to disable automatic redirects; handle 303 redirects manually by stripping the HTTP request body.

    urllib3 redirects = False
  7. Configuration

    For services you aren't expecting to respond with redirects, set urllib3 redirects=False to disable redirects.

    urllib3 redirects = False

Event History

Oct 17, 2023
CVE Published
via MITRE·07:43 PM
Data Sourced
07:43 PM
DescriptionSeverityWeakness
Advisory Published
08:15 PM
Oct 23, 2023
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Advisory Published
07:16 PM
Oct 25, 2023
Data Sourced
05:21 PM
RemedyAffected Software
Updated
05:21 PM
Severity
Oct 26, 2023
Updated
02:43 PM
Affected Software
Nov 3, 2023
Updated
03:15 AM
Affected Software
Updated
10:15 PM
Affected Software
Jan 10, 2024
Data Sourced
via Red Hat·10:43 AM
DescriptionSeverityAffected Software
Sep 13, 2024
Data Sourced
via MITRE·03:56 PM
DescriptionSeverityWeakness
Oct 17, 2024
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software
Nov 18, 2024
Data Sourced
via GitHub·11:14 PM
DescriptionSeverityWeaknessAffected Software
Nov 21, 2024
Data Sourced
via NVD·08:27 AM
RemedyDescriptionSeverityWeaknessAffected Software
Updated
via NVD·08:27 AM
RemedyAffected Software
Feb 13, 2025
Updated
via NVD·06:15 PM
DescriptionAffected Software
Updated
via GitHub·07:18 PM
Description
Apr 14, 2025
Updated
via IBM·12:00 AM
DescriptionAffected Software
Jul 23, 2025
Updated
via IBM·12:00 AM
DescriptionAffected Software
Aug 28, 2025
Updated
via IBM·12:00 AM
DescriptionAffected Software
Nov 3, 2025
Updated
via IBM·12:00 AM
Affected Software
Updated
via MITRE·09:49 PM
Description
Updated
via NVD·10:16 PM
Affected Software
Jun 17, 2026
Updated
via NVD·06:29 AM
RemedyDescriptionAffected Software
Jul 13, 2026
Updated
via IBM·12:00 AM
Affected Software

Parent advisories

This vulnerability appears in the following advisories.

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