CVE-2024-47081: Requests Requests Vulnerable To .netrc Credentials Vulnerability
MODERATECVE-2024-47081 is a MODERATE (CVSS 5.3) requests vulnerable to .netrc credentials vulnerability (CWE-522: Insufficiently Protected Credentials) affecting Requests libraries in the PyPI ecosystem. The issue involves requests vulnerable to .netrc credentials leak via malicious urls. Remediation is available by upgrading affected packages to version 2.32.4.
CVE-2024-47081 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N).
How to Fix CVE-2024-47081
To remediate this vulnerability, upgrade all affected Requests dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install requests>=2.32.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show requests
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-47081, inspect your installed packages using pip:
pip show requests
Analyze the terminal output to locate any version of Requests in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.32.4), your application is affected.
Note: The pip show requests command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-522: Insufficiently Protected Credentials, where the product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval. In Requests, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-47081 Affected Requests Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
requests
|
PyPI |
< 2.32.4
|
2.32.4
|
References
Frequently Asked Questions
What is CVE-2024-47081?
Which Requests versions are affected?
What version fixes CVE-2024-47081?
Is requests affected?
What is the CVSS score of CVE-2024-47081?
What CWE is associated with CVE-2024-47081?
How can I check PyPI dependencies for CVE-2024-47081?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9hjg-9r4m-mvj7",
"modified" : "2026-10-19T19:50:58Z",
"published" : "2025-06-09T19:06:08Z",
"aliases" : [ "CVE-2024-47081" ],
"summary" : "Requests vulnerable to .netrc credentials leak via malicious URLs",
"details" : "### Impact\n\nDue to a URL parsing issue, Requests releases prior to 2.32.4 may leak .netrc credentials to third parties for specific maliciously-crafted URLs.\n\n### Workarounds\nFor older versions of Requests, use of the .netrc file can be disabled with `trust_env=False` on your Requests Session ([docs](https://requests.readthedocs.io/en/latest/api/#requests.Session.trust_env)).\n\n### References\nhttps://github.com/psf/requests/pull/6965\nhttps://seclists.org/fulldisclosure/2025/Jun/2",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "requests"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.32.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/psf/requests/security/advisories/GHSA-9hjg-9r4m-mvj7"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-47081"
}, {
"type" : "WEB",
"url" : "https://github.com/psf/requests/pull/6965"
}, {
"type" : "WEB",
"url" : "https://github.com/psf/requests/commit/96ba401c1296ab1dda74a2365ef36d88f7d144ef"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-9hjg-9r4m-mvj7"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/psf/requests"
}, {
"type" : "WEB",
"url" : "https://github.com/psf/requests/releases/tag/v2.32.4"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/requests/PYSEC-2026-1872.yaml"
}, {
"type" : "WEB",
"url" : "https://pypi.org/project/requests"
}, {
"type" : "WEB",
"url" : "https://requests.readthedocs.io/en/latest/api/#requests.Session.trust_env"
}, {
"type" : "WEB",
"url" : "https://seclists.org/fulldisclosure/2025/Jun/2"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2025/06/03/11"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2025/06/03/9"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2025/06/04/1"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2025/06/04/6"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-522" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-06-09T19:06:08Z",
"nvd_published_at" : "2025-06-09T18:15:24Z"
}
}