# CVE-2024-47081: Requests vulnerable to .netrc credentials leak via malicious URLs

> Attackers can leak .netrc credentials to third parties via malicious URLs in the Requests HTTP library, requiring an upgrade to fix.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/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:** 9 Jun 2025
- **Updated:** 9 Jun 2025
- **Also known as:** ALPINE-CVE-2024-47081, ALSA-2025:12519, ALSA-2025:13234, ALSA-2025:13604, ALSA-2025:14750, ALSA-2025:14999, AZL-63747, AZL-63812, BELL-CVE-2024-47081, CLEANSTART-2026-IP27790, CLEANSTART-2026-TQ24260, CLSA-2026-1789975369, DEBIAN-CVE-2024-47081, ECHO-6fd0-2865-91ff, GHSA-9hjg-9r4m-mvj7, MINI-4264-8x7m-ffv5, MINI-577q-gwpm-5335, MINI-66x3-p8j6-jx66, MINI-73vj-44hp-fq62, MINI-9j85-x99w-c53f, MINI-g2p5-cxvf-4wcx, MINI-r9pq-9c7c-f6xq, OESA-2025-1674, OESA-2025-1710, OESA-2025-1711, OESA-2025-1712, OESA-2025-1825, OESA-2025-1826, OESA-2025-1827, OESA-2025-1828, OESA-2025-1979, OESA-2025-1980, OESA-2025-2173, OESA-2025-2174, OESA-2025-2175, OESA-2025-2287, PYSEC-2026-1872, RHSA-2025:12519, RHSA-2025:13234, RHSA-2025:13604, RHSA-2025:14750, RHSA-2025:14999, RHSA-2025:15121, RHSA-2025:15122, RHSA-2025:15614, RHSA-2025:15615, RHSA-2025:15616, RHSA-2025:15617, RHSA-2025:15618, RHSA-2025:15622, RHSA-2025:15691, RHSA-2025:15723, RLSA-2025:12519, RLSA-2025:13234, RLSA-2025:13604, RLSA-2025:14750, RLSA-2025:14999, ROOT-APP-PYPI-CVE-2024-47081, SUSE-SU-2025:01997-1, SUSE-SU-2025:01998-1, SUSE-SU-2025:01999-1, SUSE-SU-2025:02205-1, SUSE-SU-2025:02371-1, SUSE-SU-2025:20455-1, SUSE-SU-2025:20531-1, UBUNTU-CVE-2024-47081, openSUSE-SU-2025:15281-1

## What is CVE-2024-47081?

CVE-2024-47081 is a medium-severity vulnerability in psf requests, published on 9 Jun 2025. 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

Requests is a HTTP library. 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. Users should upgrade to version 2.32.4 to receive a fix. For older versions of Requests, use of the .netrc file can be disabled with `trust_env=False` on one's Requests Session.

Weakness: CWE-522 (Insufficiently Protected Credentials)

## Which versions are affected by CVE-2024-47081?

3 open source packages ship an affected version, including requests.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `requests` | PyPI | All versions | 2.32.4 |
| `requests` | PyPI | All versions | 2.32.4 |
| `requests` | PyPI | All versions | 2.32.4 |
| `python3-requests` | AlmaLinux:10 | All versions | 2.32.4-1.el10_0 |
| `fence-agents-all` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-amt-ws` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-apc` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-apc-snmp` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-bladecenter` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-brocade` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-cisco-mds` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-cisco-ucs` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-common` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-compute` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-drac5` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-eaton-snmp` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-emerson` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-eps` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-heuristics-ping` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-hpblade` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-ibm-powervs` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-ibm-vpc` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-ibmblade` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-ifmib` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-ilo-moonshot` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-ilo-mp` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-ilo-ssh` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-ilo2` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-intelmodular` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-ipdu` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-ipmilan` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-kdump` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-kubevirt` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-lpar` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-mpath` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-redfish` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-rhevm` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-rsa` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-rsb` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |
| `fence-agents-sbd` | AlmaLinux:8 | All versions | 4.2.1-129.el8_10.14 |

## How do I fix CVE-2024-47081?

Upgrade requests to 2.32.4 or later.

## Is CVE-2024-47081 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-47081 and fix it if it is affected.

What it is: CVE-2024-47081 is a medium-severity vulnerability in psf requests, published on 9 Jun 2025. 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-2024-47081 in the wild and no public exploit code.

Affected packages and fixed versions:
- requests (PyPI): affected all versions; fixed in 2.32.4
- requests (PyPI): affected all versions; fixed in 2.32.4
- requests (PyPI): affected all versions; fixed in 2.32.4

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-2024-47081/ (Markdown: https://insights.sbomify.com/CVE-2024-47081/index.md)
```

## Sources

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

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