CVE-2024-47081: Requests Requests Vulnerable To .netrc Credentials Vulnerability

MODERATE
Advisory Identifier: GHSA-9hjg-9r4m-mvj7
CVSS 5.3
CWE-522
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2024-47081
GHSA Identifier GHSA-9hjg-9r4m-mvj7
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-522: Insufficiently Protected Credentials
Affected Product Requests
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (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.

requests fixed: 2.32.4
pip install requests>=2.32.4
Verify Direct and Transitive Dependencies

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

### Impact Due to a URL parsing issue, Requests releases prior to 2.32.4 may leak .netrc credentials to third parties for specific maliciously-crafted URLs. ### Workarounds For 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)). ### References https://github.com/psf/requests/pull/6965 https://seclists.org/fulldisclosure/2025/Jun/2

CVE-2024-47081 Affected Requests Versions

1 component(s)
Fixed Versions:
2.32.4
Product / Package Ecosystem Affected Versions Fixed Version
requests
PyPI
< 2.32.4
2.32.4

References

Frequently Asked Questions

What is CVE-2024-47081?
CVE-2024-47081 is a security vulnerability in Requests involving Requests vulnerable to .netrc credentials leak via malicious URLs under CWE-522: Insufficiently Protected Credentials.
Which Requests versions are affected?
Affected versions include releases prior to 2.32.4 across affected packages: requests.
What version fixes CVE-2024-47081?
Upgrading to 2.32.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is requests affected?
Yes, requests is affected in releases prior to 2.32.4. Upgrade your dependency to 2.32.4 or later.
What is the CVSS score of CVE-2024-47081?
CVE-2024-47081 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2024-47081?
CVE-2024-47081 is classified under CWE-522: Insufficiently Protected Credentials (The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.).
How can I check PyPI dependencies for CVE-2024-47081?
Run the dependency tree command: 'pip show requests'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9hjg-9r4m-mvj7",
  "modified" : "2025-06-09T19:06:08Z",
  "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" : "PACKAGE",
    "url" : "https://github.com/psf/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://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"
  }
}