{"id":"CVE-2024-47081","kind":"vulnerability","aliases":["CVE-2024-47081","GHSA-9hjg-9r4m-mvj7"],"related":[],"title":"Requests vulnerable to .netrc credentials leak via malicious URLs","description":"### 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","summary":"The Python Requests library before 2.32.4 can send .netrc credentials to third-party hosts when given a specially crafted URL. An attacker who can get the application to fetch such a URL can capture the username and password stored for other hosts.","severity":"medium","cvss":5.300000190734863,"epss":0.009800000116229057,"exploited":false,"exploited_at":null,"products":[{"name":"requests","fixed":["2.32.4"],"affected":"< 2.32.4","ecosystem":"pypi"}],"ecosystems":["pypi"],"tags":["cwe-522","package","python","requests","self-hosted"],"not_affected_if":["no-netrc-file","no-untrusted-urls","upgraded-to-2.32.4"],"how_to_check":"Run: pip show requests (version below 2.32.4 is affected)\nCheck whether a .netrc file exists in the home directory of the process user (for example ~/.netrc)\nSearch the lockfile for requests: grep -i 'requests' requirements*.txt poetry.lock uv.lock","fix":"Upgrade requests to 2.32.4 or later.\nIf upgrading is not possible, set trust_env=False on the Requests Session so .netrc is not read.","status":"open","published_at":"2025-06-09T18:15:24+00:00","first_seen_at":"2026-10-23T19:11:32+00:00","triaged_at":"2026-10-23T21:48:52+00:00","updated_at":"2026-10-23T23:44:52+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-10-23T21:48:52Z","model":"claude-haiku-5-5","output":{"fix":"Upgrade requests to 2.32.4 or later.\nIf upgrading is not possible, set trust_env=False on the Requests Session so .netrc is not read.","reach":"internet","impact":"medium","summary":"The Python Requests library before 2.32.4 can send .netrc credentials to third-party hosts when given a specially crafted URL. An attacker who can get the application to fetch such a URL can capture the username and password stored for other hosts.","category":"package","who_cares":["python","requests","self-hosted"],"confidence":0.8,"needs_auth":"no","worst_case":"Attacker captures .netrc login credentials for other hosts","analyst_note":"","how_to_check":"Run: pip show requests (version below 2.32.4 is affected)\nCheck whether a .netrc file exists in the home directory of the process user (for example ~/.netrc)\nSearch the lockfile for requests: grep -i 'requests' requirements*.txt poetry.lock uv.lock","needs_analyst":false,"not_affected_if":["no-netrc-file","no-untrusted-urls","upgraded-to-2.32.4"],"user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"medium"},"cost_usd":0.000505,"input_tokens":2932,"output_tokens":423,"severity_before":"medium"},"analyst_status":null,"analyst_note":null,"search":"'-2024':11A,19A '-47081':12A,20A '-522':23B '/en/latest/api/#requests.session.trust_env)).':123C '/fulldisclosure/2025/jun/2':130C '/psf/requests/pull/6965':127C '2.32.4':35B,84C '9hjg':15A '9r4m':16A 'applic':57B 'attack':52B 'captur':64B 'craft':49B,96C 'credenti':5A,39B,88C 'cve':10A,18A 'cwe':22B 'disabl':111C 'doc':120C 'due':74C 'env':114C 'fals':115C 'fetch':59B 'file':108C 'get':55B 'ghsa':14A 'ghsa-9hjg-9r4m-mvj7':13A 'github.com':126C 'github.com/psf/requests/pull/6965':125C 'given':46B 'host':29B,44B,72B 'impact':73C 'issu':79C 'leak':6A,86C 'librari':33B 'malici':8A,95C 'maliciously-craft':94C 'may':85C 'mvj7':17A 'netrc':4A,38B,87C,107C 'older':100C 'packag':24B 'pars':78C 'parti':43B,91C 'password':68B 'prior':82C 'python':25B,31B 'refer':124C 'releas':81C 'request':1A,26B,32B,80C,103C,118C 'requests':21A 'requests.readthedocs.io':122C 'requests.readthedocs.io/en/latest/api/#requests.session.trust_env)).':121C 'seclists.org':129C 'seclists.org/fulldisclosure/2025/jun/2':128C 'self':28B 'self-host':27B 'send':37B 'session':119C 'special':48B 'specif':93C 'store':69B 'third':42B,90C 'third-parti':41B 'trust':113C 'url':9A,50B,62B,77C,97C 'use':104C 'usernam':66B 'version':101C 'via':7A 'vulner':2A 'workaround':98C","nicknames":[],"mitigations":[],"who_affected":null,"tier":null,"verified":{},"analyst_revisit_at":null,"first_public_at":"2025-06-09T18:15:24+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-9hjg-9r4m-mvj7","url":"https://github.com/advisories/GHSA-9hjg-9r4m-mvj7","severity":"medium","published_at":"2025-06-09T19:06:08+00:00","modified_at":"2026-10-19T19:51:00+00:00","first_seen_at":"2026-10-23T19:11:32+00:00","fetched_at":"2026-10-23T19:11:32+00:00","note":null},{"source":"nvd","external_id":"CVE-2024-47081","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-47081","severity":null,"published_at":"2025-06-09T18:15:24+00:00","modified_at":"2026-06-17T07:56:30+00:00","first_seen_at":"2026-10-23T23:44:52+00:00","fetched_at":"2026-10-23T23:44:52+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}