{"id":"CVE-2025-48945","aliases":["AZL-64307","AZL-67074","DEBIAN-CVE-2025-48945","EUVD-2025-28273","GHSA-5qpg-rh4j-qp35","OESA-2025-1810","OESA-2025-1811","OESA-2025-1812","OESA-2025-1813","OESA-2025-1858","SUSE-SU-2025:03354-1","UBUNTU-CVE-2025-48945","openSUSE-SU-2025:15324-1"],"status":"published","title":"pycares has a Use-After-Free Vulnerability","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.","severity":{"version":"4.0","score":8.2,"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","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00484,"percentile":0.42016,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-416"],"published":"2025-06-16T16:09:47Z","modified":"2026-11-05T05:36:30Z","fixes":[{"ecosystem":"PyPI","package":"pycares","fixed_in":["4.9.0"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:14","package":"pycares","fixed_in":["4.9.0-1"],"sources":["osv"]},{"ecosystem":"openEuler:24.03-LTS-SP1","package":"python-pycares","fixed_in":["4.9.0-1.oe2403sp1"],"sources":["osv"]},{"ecosystem":"openEuler:22.03-LTS-SP3","package":"python-pycares","fixed_in":["4.9.0-1.oe2203sp3"],"sources":["osv"]},{"ecosystem":"openEuler:22.03-LTS-SP4","package":"python-pycares","fixed_in":["4.9.0-1.oe2203sp4"],"sources":["osv"]},{"ecosystem":"openEuler:24.03-LTS","package":"python-pycares","fixed_in":["4.9.0-1.oe2403"],"sources":["osv"]},{"ecosystem":"openEuler:24.03-LTS-SP2","package":"python-pycares","fixed_in":["4.9.0-1.oe2403sp2"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Module for Python 3 15 SP6","package":"python-pycares","fixed_in":["4.10.0-150400.9.8.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Module for Python 3 15 SP7","package":"python-pycares","fixed_in":["4.10.0-150400.9.8.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS","package":"python-pycares","fixed_in":["4.10.0-150400.9.8.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS","package":"python-pycares","fixed_in":["4.10.0-150400.9.8.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS","package":"python-pycares","fixed_in":["4.10.0-150400.9.8.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS","package":"python-pycares","fixed_in":["4.10.0-150400.9.8.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Server 15 SP4-LTSS","package":"python-pycares","fixed_in":["4.10.0-150400.9.8.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Server 15 SP5-LTSS","package":"python-pycares","fixed_in":["4.10.0-150400.9.8.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Server for SAP Applications 15 SP4","package":"python-pycares","fixed_in":["4.10.0-150400.9.8.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Server for SAP Applications 15 SP5","package":"python-pycares","fixed_in":["4.10.0-150400.9.8.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Leap 15.6","package":"python-pycares","fixed_in":["4.10.0-150400.9.8.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Tumbleweed","package":"python-pycares","fixed_in":["4.9.0-1.1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"4.8.0"},{"fixed":"4.9.0"}]}]},{"source":"osv","ecosystem":"Azure Linux:2","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"3.1.1-3"}]}]},{"source":"osv","ecosystem":"Azure Linux:3","package":"python3-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"4.5.0-1"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.3.0-2","4.4.0-1","4.4.0-2","4.9.0-1","5.0.0-1","5.0.0-2","5.0.0-3","5.0.1-1","5.0.1-2","5.0.1-3"]},{"source":"osv","ecosystem":"Debian:13","package":"pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.4.0-2","4.9.0-1","5.0.0-1","5.0.0-2","5.0.0-3","5.0.1-1","5.0.1-2","5.0.1-3"]},{"source":"osv","ecosystem":"Debian:14","package":"pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.9.0-1"}]}],"versions":["4.4.0-2"]},{"source":"osv","ecosystem":"PyPI","package":"pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.9.0"}]}],"versions":["0.1.0","0.2.0","0.3.0","0.4.0","0.5.0","0.6.0","0.6.1","0.6.2","0.6.3","0.7.0","1.0.0","2.0.0","2.0.1","2.1.0","2.1.1","2.2.0","2.3.0","2.4.0","3.0.0","3.0.0b0","3.0.0b1","3.0.0b2","3.0.0b3","3.0.0b4","3.0.0b5","3.1.0","3.1.1","3.2.0","3.2.3","4.0.0","4.1.1","4.1.2","4.2.0","4.2.1","4.2.2","4.3.0","4.4.0","4.5.0","4.6.0","4.6.1","4.7.0","4.8.0"]},{"source":"osv","ecosystem":"openEuler:24.03-LTS-SP1","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.9.0-1.oe2403sp1"}]}]},{"source":"osv","ecosystem":"openEuler:22.03-LTS-SP3","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.9.0-1.oe2203sp3"}]}]},{"source":"osv","ecosystem":"openEuler:22.03-LTS-SP4","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.9.0-1.oe2203sp4"}]}]},{"source":"osv","ecosystem":"openEuler:24.03-LTS","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.9.0-1.oe2403"}]}]},{"source":"osv","ecosystem":"openEuler:24.03-LTS-SP2","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.9.0-1.oe2403sp2"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Python 3 15 SP6","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.10.0-150400.9.8.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Python 3 15 SP7","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.10.0-150400.9.8.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.10.0-150400.9.8.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.10.0-150400.9.8.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.10.0-150400.9.8.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.10.0-150400.9.8.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 15 SP4-LTSS","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.10.0-150400.9.8.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 15 SP5-LTSS","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.10.0-150400.9.8.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server for SAP Applications 15 SP4","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.10.0-150400.9.8.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server for SAP Applications 15 SP5","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.10.0-150400.9.8.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.6","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.10.0-150400.9.8.1"}]}]},{"source":"osv","ecosystem":"Ubuntu:18.04:LTS","package":"pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.1.1-2build2"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.1.1-2build4","2.1.1-2build5","2.1.1-2.1","3.1.0-3","3.1.0-4","3.1.1-1","3.1.1-1build1"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.1.1-1build3","3.1.1-1build5","4.1.2-2","4.1.2-2build1"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.3.0-2","4.3.0-2build1","4.4.0-1","4.4.0-1build1","4.4.0-1build2"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.4.0-2build2"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["5.0.1-3"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.4.0-2build2","4.4.0-2build3","4.9.0-1","5.0.0-2","5.0.1-2","5.0.1-3"]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"python-pycares","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.9.0-1.1"}]}]}],"products":[{"vendor":"aio-libs","product":"aiodns"}],"references":[{"url":"https://github.com/saghul/pycares/security/advisories/GHSA-5qpg-rh4j-qp35","tags":["x_refsource_CONFIRM","x_refsource_MISC","advisory","web","report"]},{"url":"https://github.com/aio-libs/aiodns/commit/f259a6e3650555157af53ac2b39f2ff545321d55","tags":["x_refsource_MISC","fix"]},{"url":"https://github.com/saghul/pycares/commit/ebfd7d71eb8e74bc1057a361ea79a5906db510d4","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/aio-libs/aiodns/releases/tag/v3.5.0","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/saghul/pycares/releases/tag/v4.9.0","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/advisories/GHSA-5qpg-rh4j-qp35"},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-48945","tags":["web","advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/48xxx/CVE-2025-48945.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2025-48945","tags":["advisory"]},{"url":"https://github.com/saghul/pycares","tags":["package"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2025-1810","tags":["advisory"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2025-1811","tags":["advisory"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2025-1812","tags":["advisory"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2025-1813","tags":["advisory"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2025-1858","tags":["advisory"]},{"url":"https://www.suse.com/support/update/announcement/2025/suse-su-202503354-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1244691","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2025-48945","tags":["web"]},{"url":"https://ubuntu.com/security/CVE-2025-48945","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2025-48945","tags":["report"]},{"url":"","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2025-48945","title":"pycares has a Use-After-Free Vulnerability","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.","status":"published","published":"2025-06-20T19:14:27.403Z","modified":"2025-06-20T20:06:23.612Z","cvss":[{"version":"4.0","score":8.2,"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","level":"high","assessor":"cna"}],"cwes":["CWE-416"],"updated_at":"2026-11-02T14:32:41.41198Z"}],"euvd":[{"id":"EUVD-2025-28273","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.","status":"published","published":"2025-06-20T19:14:27Z","modified":"2025-06-20T20:06:23Z","cvss":[{"version":"4.0","score":8.2,"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","level":"high"}],"updated_at":"2026-11-02T20:32:18.218874Z"}],"ghsa":[{"id":"GHSA-5qpg-rh4j-qp35","title":"pycares has a Use-After-Free Vulnerability","description":"## Summary\n\npycares 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.\n\n## Details\n\n### Root Cause\n\nThe vulnerability stems from improper handling of callback references when the Channel object is destroyed:\n\n1. When a DNS query is initiated, pycares stores a callback reference using `ffi.new_handle()`\n2. If the Channel object is garbage collected while queries are pending, the callback references become invalid\n3. When c-ares attempts to invoke the callback, it accesses freed memory, causing a fatal error\n\nThis issue was much more likely to occur when using `event_thread=True` but could happen without it under the right circumstances.\n\n### Technical Details\n\nThe core issue is a race condition between Python's garbage collector and c-ares's callback execution:\n\n1. When `__del__` is called from within a c-ares callback context, we cannot immediately call `ares_destroy()` because c-ares is still executing code after the callback returns\n2. c-ares needs to execute cleanup code after our Python callback returns (specifically at lines 1422-1429 in ares_process.c)\n3. If we destroy the channel too quickly, c-ares accesses freed memory\n\n### Impact\n\nApplications using `pycares` can be crashed remotely by triggering DNS queries that result in `Channel` objects being garbage collected before query completion. This is particularly problematic in scenarios where:\n\n- Channel objects are created per-request\n- Multiple failed DNS queries are processed rapidly\n- The application doesn't properly manage Channel lifecycle\n\nThe error manifests as:\n```\nFatal Python error: b_from_handle: ffi.from_handle() detected that the address passed points to garbage\n```\n\n## Fix\n\nThe vulnerability has been fixed in pycares 4.9.0 by implementing a safe channel destruction mechanism\n\n## Mitigation\n\n### For Application Developers\n\n1. **Upgrade to pycares \u003e= 4.9.0** - This version includes the fix and requires no code changes\n2. **Best practices** (optional but recommended):\n   ```python\n   # Explicit cleanup\n   channel.close()\n   \n   # Or use context manager\n   with pycares.Channel() as channel:\n       # ... use channel ...\n   # Automatically closed\n   ```\n3. **Avoid creating Channel objects per-request** - Prefer long-lived instances for better performance and safety\n\nThe fix is completely transparent - no API changes or code modifications are required.\n\n## Credit\n\nThis vulnerability was reported by @vEpiphyte through the aio-libs security program.","status":"published","published":"2025-06-16T16:09:47Z","modified":"2025-06-16T16:09:47Z","cwes":["CWE-416"],"updated_at":"2026-11-02T14:38:47.835488Z"}],"nvd":[{"id":"CVE-2025-48945","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.","status":"published","published":"2025-06-20T20:15:33.57Z","modified":"2026-06-17T09:30:31.813Z","cvss":[{"version":"4.0","score":8.2,"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","level":"high","assessor":"secondary"}],"cwes":["CWE-416"],"updated_at":"2026-11-02T14:11:14.091082Z"}],"osv":[{"id":"CVE-2025-48945","title":"pycares has a Use-After-Free Vulnerability","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.","status":"published","published":"2025-06-20T19:14:27.403Z","modified":"2026-10-28T02:30:35.849843307Z","cvss":[{"version":"4.0","score":8.2,"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","level":"high"}],"cwes":["CWE-416"],"updated_at":"2026-11-02T15:44:50.037003Z"},{"id":"DEBIAN-CVE-2025-48945","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.","status":"published","published":"2025-06-20T20:15:33.57Z","modified":"2026-09-01T20:05:53.345956856Z","cvss":[{"version":"4.0","score":8.2,"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","level":"high"}],"updated_at":"2026-11-02T15:45:47.378563Z"},{"id":"OESA-2025-1810","title":"python-pycares security update","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.\r\n\r\nSecurity Fix(es):\n\npycares 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.(CVE-2025-48945)","status":"published","published":"2025-07-11T11:08:53Z","modified":"2026-08-18T01:18:51.508198063Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T15:52:43.127925Z"},{"id":"OESA-2025-1811","title":"python-pycares security update","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.\r\n\r\nSecurity Fix(es):\n\npycares 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.(CVE-2025-48945)","status":"published","published":"2025-07-11T11:08:53Z","modified":"2026-08-18T01:18:51.399521655Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T15:52:43.127925Z"},{"id":"OESA-2025-1812","title":"python-pycares security update","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.\r\n\r\nSecurity Fix(es):\n\npycares 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.(CVE-2025-48945)","status":"published","published":"2025-07-11T11:08:53Z","modified":"2026-08-18T01:18:45.825688739Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T15:52:43.127925Z"},{"id":"OESA-2025-1813","title":"python-pycares security update","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.\r\n\r\nSecurity Fix(es):\n\npycares 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.(CVE-2025-48945)","status":"published","published":"2025-07-11T11:08:54Z","modified":"2026-08-18T01:18:51.397887125Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T15:52:43.127925Z"},{"id":"OESA-2025-1858","title":"python-pycares security update","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.\r\n\r\nSecurity Fix(es):\n\npycares 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.(CVE-2025-48945)","status":"published","published":"2025-07-18T11:08:56Z","modified":"2026-08-18T01:18:54.540824765Z","cvss":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T15:52:43.127925Z"},{"id":"UBUNTU-CVE-2025-48945","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.","status":"published","published":"2025-06-20T20:15:00Z","modified":"2026-10-17T12:57:03.932219372Z","cvss":[{"version":"4.0","score":8.2,"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","level":"high"}],"updated_at":"2026-11-02T16:55:50.31802Z"},{"id":"AZL-64307","title":"CVE-2025-48945 affecting package python-pycares 3.1.1-3","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.","status":"published","published":"2025-06-20T20:15:33Z","modified":"2026-04-21T04:32:21.540246Z","updated_at":"2026-11-02T15:28:07.805289Z"},{"id":"AZL-67074","title":"CVE-2025-48945 affecting package python3-pycares 4.5.0-1","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.","status":"published","published":"2025-06-20T20:15:33Z","modified":"2026-11-05T05:36:30Z","updated_at":"2026-11-05T16:41:23.841127Z"},{"id":"GHSA-5qpg-rh4j-qp35","title":"pycares has a Use-After-Free Vulnerability","description":"## Summary\n\npycares 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.\n\n## Details\n\n### Root Cause\n\nThe vulnerability stems from improper handling of callback references when the Channel object is destroyed:\n\n1. When a DNS query is initiated, pycares stores a callback reference using `ffi.new_handle()`\n2. If the Channel object is garbage collected while queries are pending, the callback references become invalid\n3. When c-ares attempts to invoke the callback, it accesses freed memory, causing a fatal error\n\nThis issue was much more likely to occur when using `event_thread=True` but could happen without it under the right circumstances.\n\n### Technical Details\n\nThe core issue is a race condition between Python's garbage collector and c-ares's callback execution:\n\n1. When `__del__` is called from within a c-ares callback context, we cannot immediately call `ares_destroy()` because c-ares is still executing code after the callback returns\n2. c-ares needs to execute cleanup code after our Python callback returns (specifically at lines 1422-1429 in ares_process.c)\n3. If we destroy the channel too quickly, c-ares accesses freed memory\n\n### Impact\n\nApplications using `pycares` can be crashed remotely by triggering DNS queries that result in `Channel` objects being garbage collected before query completion. This is particularly problematic in scenarios where:\n\n- Channel objects are created per-request\n- Multiple failed DNS queries are processed rapidly\n- The application doesn't properly manage Channel lifecycle\n\nThe error manifests as:\n```\nFatal Python error: b_from_handle: ffi.from_handle() detected that the address passed points to garbage\n```\n\n## Fix\n\nThe vulnerability has been fixed in pycares 4.9.0 by implementing a safe channel destruction mechanism\n\n## Mitigation\n\n### For Application Developers\n\n1. **Upgrade to pycares \u003e= 4.9.0** - This version includes the fix and requires no code changes\n2. **Best practices** (optional but recommended):\n   ```python\n   # Explicit cleanup\n   channel.close()\n   \n   # Or use context manager\n   with pycares.Channel() as channel:\n       # ... use channel ...\n   # Automatically closed\n   ```\n3. **Avoid creating Channel objects per-request** - Prefer long-lived instances for better performance and safety\n\nThe fix is completely transparent - no API changes or code modifications are required.\n\n## Credit\n\nThis vulnerability was reported by @vEpiphyte through the aio-libs security program.","status":"published","published":"2025-06-16T16:09:47Z","modified":"2026-09-10T03:50:24.913361759Z","cwes":["CWE-416"],"updated_at":"2026-11-02T15:46:38.553953Z"},{"id":"openSUSE-SU-2025:15324-1","title":"python311-pycares-4.9.0-1.1 on GA media","description":"These are all security issues fixed in the python311-pycares-4.9.0-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2025-07-08T00:00:00Z","modified":"2026-03-23T04:53:38.672779Z","updated_at":"2026-11-02T16:58:37.810934Z"},{"id":"SUSE-SU-2025:03354-1","title":"Security update for python-pycares","description":"This update for python-pycares fixes the following issues:\n\nUpdate to version 4.10.0 (jsc#PED-13442):  \n    \n- CVE-2025-48945: Fixed use-after-free vulnerability may have led to a crash (bsc#1244691).\n","status":"published","published":"2025-09-25T13:29:37Z","modified":"2026-03-23T04:48:46.813076Z","updated_at":"2026-11-02T15:53:57.111474Z"}]}}
