Credential Leakage Vulnerability in Requests Package: CVE-2024-47081

py3-requests Updated 02 Oct 2025

Summary

09/06/2025
N/A
Yes i
Unrated
Not published

CVE-2024-47081: Requests is a HTTP library. Affects py3-requests across 2 version ranges.

< 2.32.4-r0 < 96ba401c1296ab1dda74a2365ef36d88f7d144ef

Fixed in 2.32.4-r0. 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Requests is a widely-used HTTP library in Python that simplifies making HTTP requests. It provides a user-friendly interface for sending HTTP requests and handling responses, making it a popular choice among developers. However, it is vulnerable to a specific issue related to URL parsing that can lead to the leakage of sensitive .netrc credentials when interacting with maliciously-crafted URLs.

Vulnerability Detail

The vulnerability, identified as CVE-2024-47081, arises from a flaw in the URL parsing mechanism of the Requests library. This flaw can allow attackers to craft specific URLs that, when accessed, may inadvertently expose .netrc credentials to third parties. The potential ramifications include unauthorized access to sensitive information, which could lead to further exploitation of user accounts or systems. This issue affects all versions of Requests prior to 2.32.4.

How To Fix

Minimum fixed version

2.32.4-r0

This is the first release that contains the fix.

sudo apk add --upgrade py3-requests

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

Workaround

For users who are unable to upgrade to the patched version, a temporary workaround is to disable the use of the .netrc file by setting trust_env=False when creating a Requests Session. Here is an example of how to implement this in your code:

import requests

session = requests.Session()
session.trust_env = False

Conclusion

In summary, CVE-2024-47081 is a significant vulnerability in the Requests library that can expose sensitive .netrc credentials through malicious URLs. Users are strongly encouraged to upgrade to version 2.32.4 or later to mitigate this risk. For those unable to upgrade, a temporary workaround is available by disabling the .netrc file usage.

See every vulnerability recorded for py3-requests →

Share this vulnerability

FAQ

CVE-2024-47081 is a vulnerability in the Requests library that can lead to the leakage of .netrc credentials due to a URL parsing issue.

All versions of the Requests library prior to 2.32.4 are affected by this vulnerability.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

If upgrading is not possible, you can disable the use of the .netrc file by setting trust_env=False in your Requests Session.

The risks include unauthorized access to sensitive information, which could lead to further exploitation of user accounts or systems.

Related vulnerabilities

Recent vulnerabilities recorded for py3-requests.

How To Fix

Minimum fixed version

2.32.4-r0

This is the first release that contains the fix.

sudo apk add --upgrade py3-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