Use-after-free Vulnerability in c-ares Library by c-ares Team
CVE-2025-31498
8.3HIGH
What is CVE-2025-31498?
The c-ares library, a widely used asynchronous resolver for DNS, has a use-after-free vulnerability in the read_answers() function affecting versions from 1.32.3 to 1.34.4. This issue arises when process_answer() reallocates a query due to specific conditions such as DNS Cookie failures or improper handling of EDNS by an upstream server. Affected parties may face risks if the library is subjected to rapid ICMP UNREACHABLE packets from a malicious service or, in some scenarios, alter local system behaviors, complicating the execution of send() or write(). This issue has been resolved in version 1.34.5.
Affected Version(s)
c-ares >= 1.32.3, < 1.34.5