{"id":"CVE-2025-31498","published":"2025-04-08T13:53:11Z","modified":"2025-04-08T18:40:36Z","title":"c-ares has a use-after-free in read_answers()","vendor":"c-ares","product":"c-ares","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.3,"severity":"HIGH","version":"4.0","vector":"CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00602,"percentile":0.49731,"provenance":"source"},"cwes":[{"id":"CWE-416","name":"Use After Free"}],"references":[{"url":"https://github.com/c-ares/c-ares/security/advisories/GHSA-6hxc-62jh-p29v","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/c-ares/c-ares/pull/821","tags":["x_refsource_MISC"]},{"url":"https://github.com/c-ares/c-ares/commit/29d38719112639d8c0ba910254a3dd4f482ea2d1","tags":["x_refsource_MISC"]},{"url":"http://www.openwall.com/lists/oss-security/2025/04/08/3","tags":[]}],"priority":{"score":15.8,"factors":[{"name":"EPSS percentile","points":9.95},{"name":"CVSS severity","points":5.81}]},"vendorSlug":"c-ares","affectedVersions":[{"vendor":"c-ares","product":"c-ares","versions":[">= 1.32.3, < 1.34.5"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2025-04-08T18:40:21.274882Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2025-10377","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-c-ares-cve-2025-31498","children":[{"from":"CVE-2025-31498","to":"CVE-2025-62408","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/lib/ares_private.h","src/lib/ares_process.c"],"commits":["https://github.com/c-ares/c-ares/commit/29d38719112639d8c0ba910254a3dd4f482ea2d1","https://github.com/c-ares/c-ares/commit/714bf5675c541bd1e668a8db8e67ce012651e618"],"basis":"shared function","functions":["ares_requeue_query","ares_send_query","handle_conn_error","process_answer","process_timeouts"]}]}]}}