Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

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

Source
Associated Vulnerability
Title:`Cookie` HTTP header isn't stripped on cross-origin redirects (CVE-2023-43804)
Description: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.
Description
Example of how CVE-2023-43804 works with real python code.
Readme
# PoC
Example of how CVE-2023-43804 works with real python code.


Explaining `CVE-2023-43804/server.py` and `CVE-2023-43804/example.py`

In `server.py` I created a simple website that redirects you to google.com, so make sure to run `server.py` first before trying `example.py`.

In `example.py` I added a cookie to the request header, so when you try to request `http://127.0.0.1:5000/` (it's a local website we created via `python server.py`) you will be redirected to google.com, after that when reading `Cookies` you will find that your cookies been redirected too to be with your cookies on google.com.


This bug is fixed on URLLIB3 2.0.6, having any older version may expose to attackers.

# Support
If you would like to support me with donation, I recommend you to give it to someone who really need it please. If you do so then consider that i earned your support.

<a href="https://www.buymeacoffee.com/jawadpy" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-green.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
File Snapshot

[4.0K] /data/pocs/c08db123b150a6e255abfd89b57a06d488cb84a7 ├── [4.0K] CVE-2023-43804 │   ├── [ 605] example.py │   └── [ 232] server.py └── [1.1K] README.md 1 directory, 3 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →