CVE-2018-18074: Requests package sends HTTP Authorization header to an HTTP URI upon receiving a same-hostname HTTPS-to-HTTP redirect

requests Updated 02 Oct 2025

Summary

09/10/2018
N/A
Yes i
High
7.5

CVE-2018-18074: The Requests package before 2.20.0 for Python sends an HTTP Authorization header to an http URI upon receiving a same-hostname https-to-http redirect, which makes it easier for remote attackers to discover credentials by... Affects requests across 2 version ranges.

< 2.20.0-1 < c45d7c49ea75133e52ab22a8e9e13173938e36ff

Fixed in 2.20.0-1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The Requests package is a popular Python library used for making HTTP requests. It provides a simple and convenient way to interact with web services. The package is widely used in various applications and frameworks. However, prior to version 2.20.0, the package had a vulnerability that allowed it to send an HTTP Authorization header to an HTTP URI when it received a same-hostname HTTPS-to-HTTP redirect. This behavior could potentially expose credentials to remote attackers who can sniff the network traffic.

Vulnerability Detail

The vulnerability (CVE-2018-18074) in the Requests package arises from its incorrect handling of same-hostname HTTPS-to-HTTP redirects. When the package encounters such a redirect, it sends an HTTP Authorization header to the HTTP URI. This behavior can be exploited by attackers who have the ability to intercept network traffic. By sniffing the network, they can discover credentials that are sent in the Authorization header. The vulnerability has a CVSS score of 7.5, indicating a high severity.

How To Fix

Minimum fixed version

2.20.0-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade requests

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability.

Conclusion

The vulnerability in the Requests package (CVE-2018-18074) allows for potential exposure of credentials through network sniffing. It is crucial to upgrade to version 2.20.0-1 or later to mitigate this vulnerability. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for requests →

Share this vulnerability

FAQ

The vulnerability allows remote attackers to potentially discover credentials by sniffing network traffic.

Versions prior to 2.20.0-1 are affected.

You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Vulert uses a manifest file like package-lock.json to monitor and alert in real-time for open-source vulnerabilities.

Yes, the CVSS score for this vulnerability is 7.5, indicating a high severity.

You can find more information about this vulnerability in the CVE-2018-18074 JSON report available at https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2018-18074.json.

Related vulnerabilities

Recent vulnerabilities recorded for requests.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2.20.0-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade requests

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback