The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2024-47081

CVE-2024-47081: Requests Library Credential Leak Vulnerability

CVE-2024-47081 is a credential disclosure vulnerability in the Requests HTTP library that leaks .netrc credentials through URL parsing flaws. This article covers technical details, affected versions, and mitigation.

Published: April 15, 2026

CVE-2024-47081 Overview

CVE-2024-47081 is a sensitive data exposure vulnerability in the Python Requests HTTP library, one of the most widely-used Python packages for making HTTP requests. Due to a URL parsing issue in versions prior to 2.32.4, the library may inadvertently leak .netrc credentials to third-party hosts when processing maliciously-crafted URLs. This vulnerability stems from improper handling of the netloc component during URL parsing, allowing attackers to craft URLs that trick the library into sending stored credentials to unintended destinations.

Critical Impact

Attackers can craft malicious URLs that cause the Requests library to leak authentication credentials stored in .netrc files to unauthorized third-party servers, potentially compromising sensitive systems and accounts.

Affected Products

  • Python Requests library versions prior to 2.32.4
  • Applications and services using vulnerable Requests library versions with .netrc authentication enabled
  • Python environments where trust_env=True (default) is used in Requests Sessions

Discovery Timeline

  • June 9, 2025 - CVE-2024-47081 published to NVD
  • June 12, 2025 - Last updated in NVD database

Technical Details for CVE-2024-47081

Vulnerability Analysis

This vulnerability is classified under CWE-522 (Insufficiently Protected Credentials) and affects the credential handling mechanism in the Python Requests library. The root issue lies in how the library performs hostname lookups when retrieving credentials from .netrc files. The vulnerable code used ri.netloc.split(":")[0] to extract the hostname from a URL, which can be manipulated by attackers to cause credential leakage to unintended hosts.

The .netrc file is a standard Unix mechanism for storing machine login credentials and is commonly used for automated authentication in scripts and applications. When Requests processes a URL with trust_env=True (the default behavior), it consults the .netrc file to obtain credentials for the target host. The URL parsing flaw allows attackers to craft URLs where the netloc component is parsed incorrectly, causing credentials intended for one host to be sent to another.

Root Cause

The vulnerability originates in the src/requests/utils.py file where the library extracts the hostname for .netrc credential lookups. The flawed implementation used string splitting on the netloc attribute to remove port numbers, but this approach is susceptible to URL parsing edge cases. Specifically, the code ri.netloc.split(splitstr)[0] does not properly handle all URL formats, allowing attackers to construct URLs that bypass the intended hostname extraction logic.

Attack Vector

The attack requires user interaction where a victim's application processes a maliciously-crafted URL. The attacker must:

  1. Craft a specially-formatted URL that exploits the netloc parsing flaw
  2. Induce the victim's application to make a request to this URL using the Requests library
  3. The vulnerable code will incorrectly match the URL to a .netrc entry and send credentials to the attacker-controlled server

The attack requires network access and relies on the target application having .netrc credentials configured for the spoofed hostname.

python
# Security patch from src/requests/utils.py
# Source: https://github.com/psf/requests/commit/96ba401c1296ab1dda74a2365ef36d88f7d144ef

             return
 
         ri = urlparse(url)
-
-        # Strip port numbers from netloc. This weird `if...encode`` dance is
-        # used for Python 3.2, which doesn't support unicode literals.
-        splitstr = b":"
-        if isinstance(url, str):
-            splitstr = splitstr.decode("ascii")
-        host = ri.netloc.split(splitstr)[0]
+        host = ri.hostname
 
         try:
             _netrc = netrc(netrc_path).authenticators(host)

The fix replaces the manual string splitting with Python's built-in ri.hostname property, which correctly handles URL parsing edge cases and extracts only the hostname component.

Detection Methods for CVE-2024-47081

Indicators of Compromise

  • Unexpected outbound HTTP requests containing authentication headers to unknown third-party hosts
  • Log entries showing .netrc credential lookups for hosts that don't match expected service endpoints
  • Network traffic analysis revealing credential-bearing requests to suspicious or newly-registered domains
  • Application logs showing URL parsing anomalies or unusual netloc values

Detection Strategies

  • Scan Python environments for Requests library versions older than 2.32.4 using package auditing tools like pip-audit or safety
  • Monitor network egress traffic for authentication headers being sent to unexpected destinations
  • Implement Software Composition Analysis (SCA) in CI/CD pipelines to detect vulnerable dependencies
  • Review application logs for unusual URL patterns that may indicate exploitation attempts

Monitoring Recommendations

  • Enable verbose logging for HTTP requests in production applications to track credential usage patterns
  • Configure network monitoring to alert on authentication data being transmitted to hosts outside approved allow-lists
  • Implement runtime application security monitoring to detect anomalous credential usage
  • Set up dependency vulnerability scanning as part of regular security assessments

How to Mitigate CVE-2024-47081

Immediate Actions Required

  • Upgrade the Python Requests library to version 2.32.4 or later immediately
  • Audit all Python applications and virtual environments for vulnerable Requests versions
  • For applications that cannot be immediately upgraded, disable .netrc usage by setting trust_env=False on Requests Sessions
  • Review .netrc files to ensure credentials stored are limited to strictly necessary hosts

Patch Information

The vulnerability has been fixed in Requests version 2.32.4. The patch, available via commit 96ba401c1296ab1dda74a2365ef36d88f7d144ef, replaces the vulnerable netloc string splitting with the proper hostname attribute from Python's URL parsing library. Users should upgrade using:

bash
pip install --upgrade requests>=2.32.4

For detailed information, refer to the GitHub Security Advisory GHSA-9hjg-9r4m-mvj7 and the GitHub Pull Request Discussion.

Workarounds

  • Disable automatic environment trust by setting trust_env=False when creating Requests Sessions, which prevents .netrc credential loading
  • Remove or restrict .netrc files from systems where they are not strictly required
  • Implement network egress filtering to prevent credentials from being sent to unauthorized hosts
  • Use explicit authentication methods in code rather than relying on .netrc automatic credential loading
bash
# Workaround: Disable trust_env in Python Requests Sessions
# Add this configuration to your application code:

# Example Python code to disable .netrc usage:
# import requests
# session = requests.Session()
# session.trust_env = False
# response = session.get('https://example.com/api/endpoint')

# Verify Requests version in your environment:
pip show requests | grep Version

# Upgrade to patched version:
pip install --upgrade "requests>=2.32.4"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeInformation Disclosure

  • Vendor/TechRequests

  • SeverityMEDIUM

  • CVSS Score5.3

  • EPSS Probability0.21%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-522
  • Technical References
  • GitHub Commit Update

  • GitHub Pull Request Discussion

  • GitHub Security Advisory GHSA-9hjg-9r4m-mvj7

  • Requests Documentation API

  • Full Disclosure Mailing List Post

  • Full Disclosure Mailing List Post

  • Openwall OSS-Security Discussion

  • Openwall OSS-Security Discussion

  • Openwall OSS-Security Discussion

  • Openwall OSS-Security Discussion
  • Related CVEs
  • CVE-2024-35195: Requests Library Cert Bypass Vulnerability

  • CVE-2026-25645: Requests Library Path Traversal Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English