CVE-2025-48945 pycares has a Use-After-Free Vulnerability

High 8.2 Published Updated

An attacker can cause a denial of service by triggering a use-after-free error in pycares when a channel is garbage collected during pending DNS queries.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-48945?

CVE-2025-48945 is a high-severity use after free vulnerability in aio-libs aiodns, published on 20 Jun 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

pycares is a Python module which provides an interface to c-ares. c-ares is a C library that performs DNS requests and name resolutions asynchronously. Prior to version 4.9.0, pycares is vulnerable to a use-after-free condition that occurs when a Channel object is garbage collected while DNS queries are still pending. This results in a fatal Python error and interpreter crash. The vulnerability has been fixed in pycares 4.9.0 by implementing a safe channel destruction mechanism.

Weakness: CWE-416

Which versions are affected by CVE-2025-48945?

2 open source packages ship an affected version, including pycares.

PackageAffectedFixed in
pycares PyPIAll versions4.9.0
pycares PyPIAll versions4.9.0
Linux distribution packages (12)
python-pycares SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions4.10.0-150400.9.8.1
python-pycares SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions4.10.0-150400.9.8.1
python-pycares SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOSAll versions4.10.0-150400.9.8.1
python-pycares SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSSAll versions4.10.0-150400.9.8.1
python-pycares SUSE:Linux Enterprise Module for Python 3 15 SP6All versions4.10.0-150400.9.8.1
python-pycares SUSE:Linux Enterprise Module for Python 3 15 SP7All versions4.10.0-150400.9.8.1
python-pycares SUSE:Linux Enterprise Server 15 SP4-LTSSAll versions4.10.0-150400.9.8.1
python-pycares SUSE:Linux Enterprise Server 15 SP5-LTSSAll versions4.10.0-150400.9.8.1
python-pycares SUSE:Linux Enterprise Server for SAP Applications 15 SP4All versions4.10.0-150400.9.8.1
python-pycares SUSE:Linux Enterprise Server for SAP Applications 15 SP5All versions4.10.0-150400.9.8.1
python-pycares openSUSE:Leap 15.6All versions4.10.0-150400.9.8.1
python-pycares openSUSE:TumbleweedAll versions4.9.0-1.1

How do I fix CVE-2025-48945?

Upgrade pycares to 4.9.0 or later.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2025-48945 being exploited?

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

Sources

Also known as AZL-64307, AZL-67074, DEBIAN-CVE-2025-48945, GHSA-5qpg-rh4j-qp35, OESA-2025-1810, OESA-2025-1811 and 6 more.

Is CVE-2025-48945 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free