CVE-2023-43804: `Cookie` HTTP header isn't stripped on cross-origin redirects

Published Oct 2, 2023
·
Updated

Cookie HTTP header isn't stripped on cross-origin redirects

Other sources

urllib3 doesn't treat the Cookie HTTP header special or provide any helpers for managing cookies over HTTP, that is the responsibility of the user. However, it is possible for a user to specify a Cookie header and unknowingly leak information via HTTP redirects to a different origin if that user doesn't disable redirects explicitly.

Users must handle redirects themselves instead of relying on urllib3's automatic redirects to achieve safe processing of the Cookie header, thus we decided to strip the header by default in order to further protect users who aren't using the correct approach.

Affected usages

We believe the number of usages affected by this advisory is low. It requires all of the following to be true to be exploited:

Using an affected version of urllib3 (patched in v1.26.17 and v2.0.6) Using the Cookie header on requests, which is mostly typical for impersonating a browser. Not disabling HTTP redirects Either not using HTTPS or for the origin server to redirect to a malicious origin.

Remediation

Upgrading to at least urllib3 v1.26.17 or v2.0.6 Disabling HTTP redirects using redirects=False when sending requests. Not using the Cookie header.

— GitHub

urllib3 is a user-friendly HTTP client library for Python. urllib3 doesn't treat the Cookie HTTP header special or provide any helpers for managing cookies over HTTP, that is the responsibility of the user. However, it is possible for a user to specify a Cookie header and unknowingly leak information via HTTP redirects to a different origin if that user doesn't disable redirects explicitly. This issue has been patched in urllib3 version 1.26.17 or 2.0.5.

— NVD

Affected Software

25 affected componentsFixes available
pip/urllib3<1.26.17
1.26.17
pip/urllib3>=2.0.0<2.0.6
2.0.6
Python urllib3<1.26.17
Python urllib3>=2.0.0<2.0.6
Debian Debian Linux=10.0
Fedoraproject Fedora=37
Fedoraproject Fedora=38
Fedoraproject Fedora=39
Microsoft azl3 python-urllib3 2.0.7-1
Microsoft cbl2 python3 3.9.19-13
Microsoft azl3 python-urllib3 2.0.4-1
Microsoft cbl2 python-urllib3 1.26.18-1
redhat/urllib3<2.0.6
2.0.6
redhat/urllib3<1.26.17
1.26.17
IBM Db2 Genius Hub<=1.1, 1.1.1, 1.1.2
IBM Agentics<=1.0
ubuntu/python-pip*
ubuntu/python-urllib3<1.13.1-2ubuntu0.16.04.4+esm1
1.13.1-2ubuntu0.16.04.4+esm1
ubuntu/python-pip<8.1.1-2ubuntu0.6+esm6
8.1.1-2ubuntu0.6+esm6
ubuntu/python-urllib3<1.22-1ubuntu0.18.04.2+esm1
1.22-1ubuntu0.18.04.2+esm1
ubuntu/python-pip<9.0.1-2.3~ubuntu1.18.04.8+esm2
9.0.1-2.3~ubuntu1.18.04.8+esm2
ubuntu/python-pip<20.0.2-5ubuntu1.10
20.0.2-5ubuntu1.10
ubuntu/python-urllib3<1.25.8-2ubuntu0.3
1.25.8-2ubuntu0.3
ubuntu/python-pip<22.0.2+dfsg-1ubuntu0.4
22.0.2+dfsg-1ubuntu0.4
ubuntu/python-urllib3<1.26.5-1~exp1ubuntu0.1
1.26.5-1~exp1ubuntu0.1

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.17
  2. Upgrade

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

    Fixed in 2.0.6
  3. Upgrade

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

    Fixed in 2.0.6
  4. Upgrade

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

    Fixed in 1.26.17
  5. Upgrade

    Upgrade ubuntu/python-urllib3 to a version that resolves this vulnerability.

    Fixed in 1.13.1-2ubuntu0.16.04.4+esm1
  6. Upgrade

    Upgrade ubuntu/python-pip to a version that resolves this vulnerability.

    Fixed in 8.1.1-2ubuntu0.6+esm6
  7. Upgrade

    Upgrade ubuntu/python-urllib3 to a version that resolves this vulnerability.

    Fixed in 1.22-1ubuntu0.18.04.2+esm1
  8. Upgrade

    Upgrade ubuntu/python-pip to a version that resolves this vulnerability.

    Fixed in 9.0.1-2.3~ubuntu1.18.04.8+esm2
  9. Upgrade

    Upgrade ubuntu/python-pip to a version that resolves this vulnerability.

    Fixed in 20.0.2-5ubuntu1.10
  10. Upgrade

    Upgrade ubuntu/python-urllib3 to a version that resolves this vulnerability.

    Fixed in 1.25.8-2ubuntu0.3
  11. Upgrade

    Upgrade ubuntu/python-pip to a version that resolves this vulnerability.

    Fixed in 22.0.2+dfsg-1ubuntu0.4
  12. Upgrade

    Upgrade ubuntu/python-urllib3 to a version that resolves this vulnerability.

    Fixed in 1.26.5-1~exp1ubuntu0.1
  13. Upgrade

    Upgrade urllib3 to a version that resolves this vulnerability.

    Fixed in 1.26.17
  14. Upgrade

    Upgrade urllib3 to a version that resolves this vulnerability.

    Fixed in 2.0.6
  15. Configuration

    When sending requests with a Cookie header, disable urllib3 automatic HTTP redirects by setting redirects=False, and handle redirects yourself to prevent Cookie header leakage to a different origin.

    urllib3 redirects = False
  16. Configuration

    If you are using urllib3, avoid relying on urllib3 to manage the Cookie header across redirects; do not set the Cookie header on requests, or otherwise ensure redirects are handled safely so Cookie is not sent on cross-origin redirects.

    urllib3 Cookie header usage = not set
  17. Compensating control

    Ensure requests either do not use HTTPS or that the origin server does not redirect to a different/malicious origin, to prevent cross-origin redirects that could cause Cookie header leakage.

Event History

Oct 2, 2023
Advisory Published
11:27 PM
Data Sourced
11:27 PM
DescriptionSeverityWeaknessAffected Software
Oct 4, 2023
CVE Published
via MITRE·04:01 PM
Data Sourced
via OSV·05:15 PM
DescriptionSeverityAffected Software
Oct 9, 2023
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Oct 10, 2023
Data Sourced
01:44 PM
Remedy
Updated
01:44 PM
Severity
Nov 3, 2023
Updated
10:15 PM
Affected Software
Nov 4, 2023
Advisory Published
12:30 AM
Nov 21, 2023
Updated
04:26 PM
Affected Software
Jan 10, 2024
Data Sourced
via Red Hat·11:30 AM
DescriptionSeverityAffected Software
Jan 24, 2024
Data Sourced
via IBM·12:00 AM
DescriptionSeverityAffected Software
Feb 1, 2024
Data Sourced
via NVD·12:55 AM
RemedyDescriptionSeverityWeaknessAffected Software
Updated
via NVD·12:55 AM
Affected Software
Aug 19, 2024
Data Sourced
via MITRE·07:48 AM
DescriptionSeverityWeakness
Oct 17, 2024
Updated
via IBM·12:00 AM
Affected Software
Nov 18, 2024
Data Sourced
via GitHub·11:14 PM
DescriptionSeverityWeaknessAffected Software
Dec 13, 2024
Updated
via NVD·02:15 PM
RemedyAffected Software
Apr 14, 2025
Updated
via IBM·12:00 AM
Affected Software
Aug 17, 2025
Updated
via IBM·12:00 AM
DescriptionAffected Software
Aug 19, 2025
Updated
via IBM·12:00 AM
Affected Software
Aug 28, 2025
Updated
via IBM·12:00 AM
Affected Software
Nov 3, 2025
Updated
via NVD·10:16 PM
Affected Software
Jun 17, 2026
Updated
via NVD·06:26 AM
Affected Software
Jul 13, 2026
Updated
via IBM·12:00 AM
Affected Software
Sep 20, 2026
Exploit Published
via GitHub·02:07 PM

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the vulnerability ID of this issue?

The vulnerability ID is CVE-2023-43804.

2

What is the severity of CVE-2023-43804?

The severity of CVE-2023-43804 is medium with a severity value of 5.9.

3

Which software is affected by CVE-2023-43804?

urllib3 versions up to 1.26.17 and versions up to 2.0.6 are affected by CVE-2023-43804.

4

How can I fix CVE-2023-43804?

To fix CVE-2023-43804, you should update urllib3 to version 1.26.17 or version 2.0.6.

5

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

You can find more information about CVE-2023-43804 at the following references: [GitHub Advisory](https://github.com/urllib3/urllib3/security/advisories/GHSA-v845-jxx5-vc9f), [GitHub Commit 1](https://github.com/urllib3/urllib3/commit/01220354d389cd05474713f8c982d05c9b17aafb), [GitHub Commit 2](https://github.com/urllib3/urllib3/commit/644124ecd0b6e417c527191f866daa05a5a2056d).

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