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-2025-48945

CVE-2025-48945: pycares Use-After-Free Vulnerability

CVE-2025-48945 is a use-after-free vulnerability in pycares that causes Python interpreter crashes when Channel objects are freed during active DNS queries. This article covers technical details, affected versions, and mitigation.

Published: May 11, 2026

CVE-2025-48945 Overview

CVE-2025-48945 is a use-after-free vulnerability [CWE-416] in pycares, a Python module that provides bindings to the c-ares asynchronous DNS resolution library. The flaw affects pycares versions prior to 4.9.0. The vulnerability triggers when a Channel object is garbage collected while DNS queries remain pending, producing a fatal Python error and interpreter crash. Downstream projects such as aiodns are also impacted and require the patched dependency.

Critical Impact

Remote attackers can trigger an interpreter crash in any Python application that uses pycares for DNS resolution, resulting in denial of service for services such as async HTTP clients, scanners, and resolvers.

Affected Products

  • pycares versions prior to 4.9.0
  • aiodns versions prior to 3.5.0 (transitive dependency)
  • Python applications and services using pycares.Channel for asynchronous DNS

Discovery Timeline

  • 2025-06-20 - CVE-2025-48945 published to NVD
  • 2026-04-15 - Last updated in NVD database

Technical Details for CVE-2025-48945

Vulnerability Analysis

The vulnerability resides in the lifecycle management of the pycares Channel object. The Channel wraps a native c-ares resolver context that tracks in-flight DNS queries and their callbacks. When Python's garbage collector reclaims a Channel instance while queries are still pending, the underlying c-ares structures are destroyed without first canceling or draining outstanding requests. Subsequent callback invocations dereference freed memory, producing a fatal interpreter error.

The defect is classified under CWE-416 (Use After Free). The attack vector is network-based because remote DNS responses or remote-controlled hostnames can influence when queries complete relative to channel destruction. Any service that resolves attacker-influenced names while channels are transient is exposed to denial of service.

Root Cause

The root cause is the absence of a safe shutdown path between the Python Channel wrapper and the native c-ares channel. Prior to 4.9.0, channel destruction during garbage collection raced against pending query callbacks. The maintainers addressed this by introducing a thread-safe close() method and a serialized destruction queue that processes one channel per second to guarantee c-ares teardown safety.

Attack Vector

Exploitation requires only that a target application create and destroy pycares Channel objects while queries are outstanding. Attackers who can induce slow or never-resolving DNS lookups, or who can prolong query lifetimes through controlled authoritative servers, can reliably race channel garbage collection. The result is an interpreter crash and loss of service availability.

python
# Patched usage pattern from pycares 4.9.0 (examples/cares-asyncio-event-thread.py)
import asyncio
import socket
from typing import Any, Callable, Optional

import pycares


class DNSResolver:
    def __init__(self, loop: Optional[asyncio.AbstractEventLoop] = None) -> None:
        # Use event_thread=True for automatic event handling in a separate thread
        self._channel = pycares.Channel(event_thread=True)
        self.loop = loop or asyncio.get_running_loop()

    def query(
        self, name: str, query_type: int, cb: Callable[[Any, Optional[int]], None]
    ) -> None:
        self._channel.query(name, query_type, cb)

    def gethostbyname(
        self, name: str, cb: Callable[[Any, Optional[int]], None]
    ) -> None:
        self._channel.gethostbyname(name, socket.AF_INET, cb)

    def close(self) -> None:
        """Thread-safe shutdown of the channel."""
        # Simply call close() - it's thread-safe and handles everything
        self._channel.close()

Source: pycares commit ebfd7d71

Detection Methods for CVE-2025-48945

Indicators of Compromise

  • Unexpected Fatal Python error messages in application logs referencing pycares or c-ares callbacks
  • Repeated worker or process restarts in services that perform asynchronous DNS resolution
  • Core dumps or crash artifacts originating from Python processes linked against libcares

Detection Strategies

  • Inventory Python environments and identify installations of pycares below version 4.9.0 and aiodns below 3.5.0 using pip list or SBOM tooling.
  • Monitor process supervisors for abnormal Python interpreter exit codes correlated with DNS-heavy workloads.
  • Review CI and dependency scanning output for GitHub Security Advisory GHSA-5qpg-rh4j-qp35.

Monitoring Recommendations

  • Alert on Python process crashes that emit stack traces involving pycares.Channel or ares_destroy.
  • Track DNS query latency and timeout rates to identify conditions that increase the likelihood of channel destruction races.
  • Audit application code paths that instantiate transient Channel objects per request rather than reusing a long-lived instance.

How to Mitigate CVE-2025-48945

Immediate Actions Required

  • Upgrade pycares to version 4.9.0 or later across all Python environments.
  • Upgrade aiodns to 3.5.0 or later to pull in the patched pycares dependency.
  • Refactor application code to reuse a single long-lived Channel instance and explicitly call close() rather than relying on garbage collection.

Patch Information

The fix is delivered in pycares 4.9.0 and aiodns 3.5.0. The pycares patch introduces a thread-safe channel destruction mechanism with a serialized teardown queue limited to 60 channels per minute. Refer to the GitHub Security Advisory GHSA-5qpg-rh4j-qp35, the pycares v4.9.0 release, and the aiodns v3.5.0 release for full details.

Workarounds

  • Avoid creating transient Channel objects per DNS query; instantiate one resolver and reuse it for the lifetime of the application.
  • Wrap channel usage in the context manager protocol or call channel.close() explicitly before allowing references to drop.
  • For applications with high query volume, implement a small channel pool rather than ad-hoc creation and destruction.
bash
# Upgrade the vulnerable packages
pip install --upgrade 'pycares>=4.9.0' 'aiodns>=3.5.0'

# Verify installed versions
python -c "import pycares; print(pycares.__version__)"
python -c "import aiodns; print(aiodns.__version__)"

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

  • Vulnerability Details
  • TypeUse After Free

  • Vendor/TechPycares

  • SeverityHIGH

  • CVSS Score8.2

  • EPSS Probability0.51%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-416
  • Technical References
  • GitHub Commit Update

  • GitHub Release v3.5.0

  • GitHub Commit Update

  • GitHub Release v4.9.0

  • GitHub Security Advisory GHSA-5qpg-rh4j-qp35
  • Latest CVEs
  • CVE-2026-8468: Elixir Plug Library DoS Vulnerability

  • CVE-2026-8295: simdjson Information Disclosure Vulnerability

  • CVE-2025-68421: Comarch ERP Optima Auth Bypass Vulnerability

  • CVE-2025-68420: Comarch ERP Optima Privilege Escalation
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