# CVE-2018-25091: Authorization Header forwarded on redirect

> Attackers can steal credentials from the Authorization header when urllib3 follows cross-origin redirects, exposing sensitive data to unintended hosts.

- **Severity:** Medium 6.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 15 Oct 2023
- **Updated:** 16 Sep 2024
- **Also known as:** DEBIAN-CVE-2018-25091, GHSA-gwvm-45gx-3cf8, MINI-8fh3-2g5h-8pr2, PYSEC-2023-207, ROOT-APP-PYPI-CVE-2018-25091, UBUNTU-CVE-2018-25091

## What is CVE-2018-25091?

CVE-2018-25091 is a medium-severity vulnerability in n/a, published on 15 Oct 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

urllib3 before 1.24.2 does not remove the authorization HTTP header when following a cross-origin redirect (i.e., a redirect that differs in host, port, or scheme). This can allow for credentials in the authorization header to be exposed to unintended hosts or transmitted in cleartext. NOTE: this issue exists because of an incomplete fix for CVE-2018-20060 (which was case-sensitive).

Weakness: CWE-601 (URL Redirection to Untrusted Site)

## Which versions are affected by CVE-2018-25091?

3 open source packages ship an affected version, including urllib3. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `urllib3` | PyPI | All versions | 1.24.2 |
| `urllib3` | PyPI | All versions | 1.24.2 |
| `urllib3` | PyPI | All versions | 1.24.2 |

Products: Python Urllib3.

## How do I fix CVE-2018-25091?

Upgrade urllib3 to 1.24.2 or later.

## Is CVE-2018-25091 being exploited?

There is no known exploitation of CVE-2018-25091 in the wild and no public exploit code.

## Other vulnerabilities in n/a

- [CVE-2026-97689](https://insights.sbomify.com/CVE-2026-97689/): urllib3: HTTPResponse.stream()/read_chunked() buffers an unbounded chunk-size line into memory (high 8.9)
- [CVE-2026-44432](https://insights.sbomify.com/CVE-2026-44432/): urllib3: Decompression-bomb safeguards bypassed in parts of the streaming API (high 8.9)
- [CVE-2026-21441](https://insights.sbomify.com/CVE-2026-21441/): urllib3 vulnerable to decompression-bomb safeguard bypass when following HTTP redirects (streaming API) (high 8.9)
- [CVE-2025-66418](https://insights.sbomify.com/CVE-2025-66418/): urllib3 allows an unbounded number of links in the decompression chain (high 8.9)
- [CVE-2025-66471](https://insights.sbomify.com/CVE-2025-66471/): urllib3 Streaming API improperly handles highly compressed data (high 8.9)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2018-25091 and fix it if it is affected.

What it is: CVE-2018-25091 is a medium-severity vulnerability in n/a, published on 15 Oct 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2018-25091 in the wild and no public exploit code.

Affected packages and fixed versions:
- urllib3 (PyPI): affected all versions; fixed in 1.24.2
- urllib3 (PyPI): affected all versions; fixed in 1.24.2
- urllib3 (PyPI): affected all versions; fixed in 1.24.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2018-25091/ (Markdown: https://insights.sbomify.com/CVE-2018-25091/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2018-25091
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2018-25091
- OSV: https://osv.dev/vulnerability/CVE-2018-25091

---
From sbomify Insights: https://insights.sbomify.com/CVE-2018-25091/
Summaries are generated and may contain mistakes; the official description above is the record.
