Use After Free Affecting pycares package, versions [,4.9.0)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.06% (19th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Use After Free vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-PYCARES-10365309
  • published17 Jun 2025
  • disclosed16 Jun 2025
  • creditvEpiphyte

Introduced: 16 Jun 2025

NewCVE-2025-48945  (opens in a new tab)
CWE-416  (opens in a new tab)

How to fix?

Upgrade pycares to version 4.9.0 or higher.

Overview

Affected versions of this package are vulnerable to Use After Free via improper handling of callback references during the destruction of the Channel object. An attacker can cause a fatal interpreter crash by triggering DNS queries that result in the Channel object being garbage collected before the queries complete. This is particularly problematic in scenarios where:

  • Channel objects are created per-request
  • Multiple failed DNS queries are processed rapidly
  • The application doesn't properly manage Channel lifecycle

Note: This issue is much more likely to occur when using event_thread=True but could happen without it under the right circumstances.

References

CVSS Base Scores

version 4.0
version 3.1