CVE-2025-31498 Details
Description
c-ares is an asynchronous resolver library. From 1.32.3 through 1.34.4, there is a use-after-free in read_answers() when process_answer() may re-enqueue a query either due to a DNS Cookie Failure or when the upstream server does not properly support EDNS, or possibly on TCP queries if the remote closed the connection immediately after a response. If there was an issue trying to put that new transaction on the wire, it would close the connection handle, but read_answers() was still expecting the connection handle to be available to possibly dequeue other responses. In theory a remote attacker might be able to trigger this by flooding the target with ICMP UNREACHABLE packets if they also control the upstream nameserver and can return a result with one of those conditions, this has been untested. Otherwise only a local attacker might be able to change system behavior to make send()/write() return a failure condition. This vulnerability is fixed in 1.34.5.
A use-after-free vulnerability has been identified in the c-ares library, which is an asynchronous DNS resolver. This issue affects versions 1.32.3 through 1.34.4. The vulnerability arises in the 'read_answers()' function, where the 'process_answer()' function may re-enqueue a query due to DNS Cookie failures or improper EDNS support from the upstream server. Additionally, on TCP queries, if the remote server closes the connection immediately after a response, this can trigger the vulnerability. In such cases, 'read_answers()' expects the connection handle to be available for dequeuing responses, but the handle may have been closed, leading to a use-after-free condition.
Users can upgrade to c-ares version 1.34.5, where this vulnerability has been patched.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Apr 8, 2025CISA-ADP
Assessed Apr 8, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| http://www.openwall.com/lists/oss-security/2025/04/08/3 | CVE | Mailing ListRemedy |
| https://github.com/c-ares/c-ares/commit/29d38719112639d8c0ba910254a3dd4f482ea2d1 | [email protected] | Source CodeVendor |
| https://github.com/c-ares/c-ares/pull/821 | [email protected] | Issue TrackingSource CodeVendor |
| https://github.com/c-ares/c-ares/security/advisories/GHSA-6hxc-62jh-p29v | [email protected] | AdvisoryRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-416 | Use After Free | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| c-ares | >= 1.32.3, <= 1.34.4 (semver) |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Apr 8, 2025 | CVE Modified | CVE |
| Apr 8, 2025 | New CVE Received | [email protected] |
Volerion