cve.bz

CVE-2025-31498 c-ares c-ares: Use After Free

8.3 highEPSS 0.6%

High (8.3) in c-ares c-ares. EPSS 0.6% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 4.0

8.3 high
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
EPSS
0.6% (unchanged from 0.6% a week ago; 0.6% 30 days ago) estimated probability of exploitation activity in the next 30 days; 50th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2025-04-08. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-416 Use After Free
Published
Modified
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2025-31498 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2025-31498?via=ask-ai-copy and https://cve.bz/cve/CVE-2025-31498?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2025-31498 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
c-ares>= 1.32.3, < 1.34.5

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian13, 14c-ares1.34.5-1DEBIAN-CVE-2025-31498
Ubuntu25.04c-ares1.34.4-2.1ubuntu0.1USN-7477-1
Red Hatenterprise_linux:8::appstreamnodejs, nodejs-docs, nodejs-devel and 3 more1:20.19.1-1.module+el8.10.0+23054+5431297fRHSA-2025:4461
Red Hatenterprise_linux:8::appstreamnodejs, nodejs-docs, nodejs-libs and 5 more1:22.15.0-1.module+el8.10.0+23068+28ff2340RHSA-2025:4459
Red Hatenterprise_linux:8::appstreamnodejs-nodemon0:3.0.1-1.module+el8.10.0+22904+d0fedeffRHSA-2025:4461
Red Hatenterprise_linux:8::appstreamnodejs-nodemon0:3.0.1-1.module+el8.10.0+23068+28ff2340RHSA-2025:4459
Red Hatenterprise_linux:8::appstreamnodejs-packaging, nodejs-packaging-bundler0:2021.06-4.module+el8.10.0+22904+d0fedeffRHSA-2025:4461
Red Hatenterprise_linux:8::appstreamnodejs-packaging, nodejs-packaging-bundler0:2021.06-4.module+el8.10.0+23068+28ff2340RHSA-2025:4459
Red Hatenterprise_linux:8::appstreamnpm1:10.8.2-1.20.19.1.1.module+el8.10.0+23054+5431297fRHSA-2025:4461
Red Hatenterprise_linux:8::appstreamnpm1:10.9.2-1.22.15.0.1.module+el8.10.0+23068+28ff2340RHSA-2025:4459
Red Hatenterprise_linux:8::appstreamv8-12.4-devel3:12.4.254.21-1.22.15.0.1.module+el8.10.0+23068+28ff2340RHSA-2025:4459
Red Hatenterprise_linux:9::appstreamnodejs, nodejs-docs, nodejs-devel and 3 more1:20.19.1-1.module+el9.6.0+23053+4195b0b2RHSA-2025:7426
Red Hatenterprise_linux:9::appstreamnodejs, nodejs-docs, nodejs-libs and 5 more1:22.15.0-1.module+el9.6.0+23062+9e7801b9RHSA-2025:7433
Red Hatenterprise_linux:9::appstreamnodejs-nodemon0:3.0.1-1.module+el9.3.0.z+20478+84a9f781RHSA-2025:7426
12 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSS, Linux Enterprise High Performance Computing 15 SP5-ESPOS and 11 morec-ares1.34.8-150000.3.29.1SUSE-SU-2026:4021-1
SUSELinux Micro 6.0c-ares1.34.8-1.1SUSE-SU-2026:23364-1
SUSELinux Micro 6.1c-ares1.34.8-slfo.1.1_1.1SUSE-SU-2026:23414-1
openSUSETumbleweedc-ares1.34.5-1.1openSUSE-SU-2025:14977-1
AlmaLinux8nodejs, nodejs-docs, nodejs-devel and 1 more1:20.19.1-1.module_el8.10.0+3987+dbda4426ALSA-2025:4461
AlmaLinux8nodejs, nodejs-docs, nodejs-libs and 2 more1:22.15.0-1.module_el8.10.0+3986+a908e756ALSA-2025:4459
AlmaLinux8nodejs-nodemon3.0.1-1.module_el8.10.0+3982+85c136aaALSA-2025:4461
AlmaLinux8nodejs-nodemon3.0.1-1.module_el8.10.0+3983+391a1a04ALSA-2025:4459
AlmaLinux8nodejs-packaging2021.06-4.module_el8.10.0+3987+dbda4426ALSA-2025:4461
AlmaLinux8nodejs-packaging, nodejs-packaging-bundler2021.06-4.module_el8.10.0+3961+6a788e57ALSA-2025:4459
AlmaLinux8nodejs-packaging-bundler2021.06-4.module_el8.10.0+3958+472a6467ALSA-2025:4461
AlmaLinux8npm1:10.8.2-1.20.19.1.1.module_el8.10.0+3987+dbda4426ALSA-2025:4461
AlmaLinux8npm1:10.9.2-1.22.15.0.1.module_el8.10.0+3986+a908e756ALSA-2025:4459
AlmaLinux8v8-12.4-devel3:12.4.254.21-1.22.15.0.1.module_el8.10.0+3986+a908e756ALSA-2025:4459
AlmaLinux9nodejs, nodejs-docs, nodejs-devel and 1 more1:20.19.1-1.module_el9.6.0+163+d268fe53ALSA-2025:7426
AlmaLinux9nodejs, nodejs-docs, nodejs-libs and 2 more1:22.15.0-1.module_el9.6.0+164+2d89b8edALSA-2025:7433
9 more for AlmaLinux in the JSON.
Rocky Linux8nodejs1:20.19.1-1.module+el8.10.0+1972+57cf735fRLSA-2025:4461
Rocky Linux8nodejs1:22.15.0-1.module+el8.10.0+1971+0bb08eceRLSA-2025:4459
Rocky Linux8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1666+930e28e8RLSA-2025:4459 RLSA-2025:4461
Rocky Linux8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1667+4a788d89RLSA-2025:4459 RLSA-2025:4461
Rocky Linux8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1823+b5789597RLSA-2025:4459 RLSA-2025:4461
Rocky Linux8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1824+532140eeRLSA-2025:4459 RLSA-2025:4461
Rocky Linux8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1924+614dc87fRLSA-2025:4459 RLSA-2025:4461
Rocky Linux8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1935+d3cbe60fRLSA-2025:4459 RLSA-2025:4461
Rocky Linux8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1988+437f3d23RLSA-2025:4459 RLSA-2025:4461
Rocky Linux8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1989+e60144d9RLSA-2025:4459 RLSA-2025:4461
Rocky Linux8nodejs-nodemon0:3.0.1-1.module+el8.9.0+1760+903d54b9RLSA-2025:4459 RLSA-2025:4461
Rocky Linux8nodejs-packaging0:2021.06-4.module+el8.10.0+1667+4a788d89RLSA-2025:4459 RLSA-2025:4461
11 more for Rocky Linux in the JSON.
Alpinev3.21, v3.22, v3.23 and 1 morec-ares1.34.5-r0ALPINE-CVE-2025-31498
Azure Linux3fluent-bit3.1.9-4AZL-59742
Alpaquitastreamc-ares1.34.5-r0BELL-CVE-2025-31498
BellSoft Hardened Containersstreamc-ares1.34.5-r0BELL-CVE-2025-31498

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine · Alpaquita · BellSoft Hardened Containers.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

This vulnerability is rated as moderate severity rather than important because successful exploitation requires a complex and unlikely set of conditions. While it is a use-after-free bug—typically a serious issue—the ability to trigger it remotely is largely theoretical. An attacker would need to control an upstream DNS server and simultaneously flood the target with ICMP UNREACHABLE packets to influence network behavior precisely, a scenario that is difficult to achieve in practice. Additionally, local exploitation depends on manipulating low-level socket behavior to induce send() or write() failures, which also requires elevated system influence or specific environmental conditions.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10nodejs22-1:22.15.0-1.el10_0Fixed 2025-05-13RHSA-2025:7502
Red Hat Enterprise Linux 8nodejs:22-8100020250429143334.6d880403Fixed 2025-05-05RHSA-2025:4459
Red Hat Enterprise Linux 8nodejs:20-8100020250425153222.489197e6Fixed 2025-05-05RHSA-2025:4461
Red Hat Enterprise Linux 9nodejs:20-9060020250425155626.rhel9Fixed 2025-05-13RHSA-2025:7426
Red Hat Enterprise Linux 9nodejs:22-9060020250428105352.rhel9Fixed 2025-05-13RHSA-2025:7433
Red Hat Enterprise Linux 9.4 Extended Update Supportnodejs:20-9040020250506133952.rhel9Fixed 2025-05-14RHSA-2025:7537
Red Hat Enterprise Linux 10c-aresNot affected
Red Hat Enterprise Linux 6c-aresOut of support scope
Red Hat Enterprise Linux 7c-aresOut of support scope
Red Hat Enterprise Linux 8c-aresNot affected
Red Hat Enterprise Linux 8nodejs:18/nodejsNot affected
Red Hat Enterprise Linux 9c-aresNot affected
Red Hat Enterprise Linux 9nodejs:18/nodejsNot affected
Red Hat OpenShift Container Platform 4openshift/ose-rhel-coreos-8Not affected
Red Hat OpenShift Container Platform 4openshift/ose-rhel-coreos-9Not affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2025-31498.

References

Check your stackJSON