Vulnerability · Published Apr 8, 2025 · Assigned by GitHub_M

CVE-2025-31498c-ares has a use-after-free in read_answers()

High 8.3

In plain English

A high-severity use-after-free in c-ares from c-ares. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 49% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)8.3High
Exploit odds (30 days)0.6%top 51.0% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
AlmaLinux:10nodejs1:22.15.0-1.el10_0ALSA-2025:7502
AlmaLinux:8nodejs1:22.15.0-1.module_el8.10.0+3986+a908e756ALSA-2025:4459
AlmaLinux:8nodejs1:20.19.1-1.module_el8.10.0+3987+dbda4426ALSA-2025:4461
AlmaLinux:9nodejs1:22.15.0-1.module_el9.6.0+164+2d89b8edALSA-2025:7433
AlmaLinux:9nodejs1:20.19.1-1.module_el9.6.0+163+d268fe53ALSA-2025:7426
AlmaLinux:10nodejs-devel1:22.15.0-1.el10_0ALSA-2025:7502
AlmaLinux:8nodejs-devel1:20.19.1-1.module_el8.10.0+3987+dbda4426ALSA-2025:4461
AlmaLinux:8nodejs-devel1:22.15.0-1.module_el8.10.0+3986+a908e756ALSA-2025:4459
AlmaLinux:9nodejs-devel1:20.19.1-1.module_el9.6.0+163+d268fe53ALSA-2025:7426
AlmaLinux:9nodejs-devel1:22.15.0-1.module_el9.6.0+164+2d89b8edALSA-2025:7433
AlmaLinux:10nodejs-docs1:22.15.0-1.el10_0ALSA-2025:7502
AlmaLinux:8nodejs-docs1:20.19.1-1.module_el8.10.0+3987+dbda4426ALSA-2025:4461
AlmaLinux:8nodejs-docs1:22.15.0-1.module_el8.10.0+3986+a908e756ALSA-2025:4459
AlmaLinux:9nodejs-docs1:22.15.0-1.module_el9.6.0+164+2d89b8edALSA-2025:7433
AlmaLinux:9nodejs-docs1:20.19.1-1.module_el9.6.0+163+d268fe53ALSA-2025:7426
AlmaLinux:10nodejs-full-i18n1:22.15.0-1.el10_0ALSA-2025:7502
AlmaLinux:8nodejs-full-i18n1:22.15.0-1.module_el8.10.0+3986+a908e756ALSA-2025:4459
AlmaLinux:8nodejs-full-i18n1:20.19.1-1.module_el8.10.0+3987+dbda4426ALSA-2025:4461
AlmaLinux:9nodejs-full-i18n1:20.19.1-1.module_el9.6.0+163+d268fe53ALSA-2025:7426
AlmaLinux:9nodejs-full-i18n1:22.15.0-1.module_el9.6.0+164+2d89b8edALSA-2025:7433
AlmaLinux:10nodejs-libs1:22.15.0-1.el10_0ALSA-2025:7502
AlmaLinux:8nodejs-libs1:22.15.0-1.module_el8.10.0+3986+a908e756ALSA-2025:4459
AlmaLinux:9nodejs-libs1:22.15.0-1.module_el9.6.0+164+2d89b8edALSA-2025:7433
AlmaLinux:8nodejs-nodemon3.0.1-1.module_el8.10.0+3983+391a1a04ALSA-2025:4459
AlmaLinux:8nodejs-nodemon3.0.1-1.module_el8.10.0+3982+85c136aaALSA-2025:4461
AlmaLinux:9nodejs-nodemon3.0.1-1.module_el9.5.0+139+09296491ALSA-2025:7433
AlmaLinux:9nodejs-nodemon3.0.1-1.module_el9.5.0+125+8dc38870ALSA-2025:7426
AlmaLinux:10nodejs-npm1:10.9.2-1.22.15.0.1.el10_0ALSA-2025:7502
AlmaLinux:8nodejs-packaging2021.06-4.module_el8.10.0+3961+6a788e57ALSA-2025:4459
AlmaLinux:8nodejs-packaging2021.06-4.module_el8.10.0+3987+dbda4426ALSA-2025:4461
AlmaLinux:9nodejs-packaging2021.06-4.module_el9.6.0+162+8dc602e5ALSA-2025:7426
AlmaLinux:9nodejs-packaging2021.06-4.module_el9.5.0+139+09296491ALSA-2025:7433
AlmaLinux:8nodejs-packaging-bundler2021.06-4.module_el8.10.0+3958+472a6467ALSA-2025:4461
AlmaLinux:8nodejs-packaging-bundler2021.06-4.module_el8.10.0+3961+6a788e57ALSA-2025:4459
AlmaLinux:9nodejs-packaging-bundler2021.06-4.module_el9.6.0+162+8dc602e5ALSA-2025:7426
AlmaLinux:9nodejs-packaging-bundler2021.06-4.module_el9.5.0+139+09296491ALSA-2025:7433
AlmaLinux:8npm1:10.8.2-1.20.19.1.1.module_el8.10.0+3987+dbda4426ALSA-2025:4461
AlmaLinux:8npm1:10.9.2-1.22.15.0.1.module_el8.10.0+3986+a908e756ALSA-2025:4459
AlmaLinux:9npm1:10.9.2-1.22.15.0.1.module_el9.6.0+164+2d89b8edALSA-2025:7433
AlmaLinux:9npm1:10.8.2-1.20.19.1.1.module_el9.6.0+163+d268fe53ALSA-2025:7426
AlmaLinux:8v8-12.4-devel3:12.4.254.21-1.22.15.0.1.module_el8.10.0+3986+a908e756ALSA-2025:4459
AlmaLinux:9v8-12.4-devel3:12.4.254.21-1.22.15.0.1.module_el9.6.0+164+2d89b8edALSA-2025:7433
Alpine:v3.21c-ares1.34.5-r0ALPINE-CVE-2025-31498
Alpine:v3.22c-ares1.34.5-r0ALPINE-CVE-2025-31498
Alpine:v3.23c-ares1.34.5-r0ALPINE-CVE-2025-31498
Alpine:v3.24c-ares1.34.5-r0ALPINE-CVE-2025-31498
Debian:13c-ares1.34.5-1DEBIAN-CVE-2025-31498
Debian:14c-ares1.34.5-1DEBIAN-CVE-2025-31498
Rocky Linux:8nodejs1:22.15.0-1.module+el8.10.0+1971+0bb08eceRLSA-2025:4459
Rocky Linux:8nodejs1:20.19.1-1.module+el8.10.0+1972+57cf735fRLSA-2025:4461
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1667+4a788d89RLSA-2025:4461
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1988+437f3d23RLSA-2025:4459
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1989+e60144d9RLSA-2025:4459
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.9.0+1760+903d54b9RLSA-2025:4459
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1666+930e28e8RLSA-2025:4459
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1667+4a788d89RLSA-2025:4459
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1823+b5789597RLSA-2025:4459
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1824+532140eeRLSA-2025:4459
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1924+614dc87fRLSA-2025:4459
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1935+d3cbe60fRLSA-2025:4459
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1988+437f3d23RLSA-2025:4461
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1989+e60144d9RLSA-2025:4461
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.9.0+1760+903d54b9RLSA-2025:4461
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1666+930e28e8RLSA-2025:4461
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1823+b5789597RLSA-2025:4461
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1824+532140eeRLSA-2025:4461
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1924+614dc87fRLSA-2025:4461
Rocky Linux:8nodejs-nodemon0:3.0.1-1.module+el8.10.0+1935+d3cbe60fRLSA-2025:4461
Rocky Linux:9nodejs-nodemon0:3.0.1-1.module+el9.5.0+31770+0da7192dRLSA-2025:7426
Rocky Linux:9nodejs-nodemon0:3.0.1-1.module+el9.5.0+31785+5534beb0RLSA-2025:7433
Rocky Linux:9nodejs-nodemon0:3.0.1-1.module+el9.5.0+31770+0da7192dRLSA-2025:7433
Rocky Linux:9nodejs-nodemon0:3.0.1-1.module+el9.5.0+31785+5534beb0RLSA-2025:7426
Rocky Linux:8nodejs-packaging0:2021.06-4.module+el8.10.0+1824+532140eeRLSA-2025:4461
Rocky Linux:8nodejs-packaging0:2021.06-4.module+el8.10.0+1924+614dc87fRLSA-2025:4461
Rocky Linux:8nodejs-packaging0:2021.06-4.module+el8.10.0+1988+437f3d23RLSA-2025:4461
Rocky Linux:8nodejs-packaging0:2021.06-4.module+el8.10.0+1989+e60144d9RLSA-2025:4461
Rocky Linux:8nodejs-packaging0:2021.06-4.module+el8.9.0+1419+1f26ef47RLSA-2025:4461
Rocky Linux:8nodejs-packaging0:2021.06-4.module+el8.10.0+1667+4a788d89RLSA-2025:4459
Rocky Linux:8nodejs-packaging0:2021.06-4.module+el8.10.0+1823+b5789597RLSA-2025:4459
Rocky Linux:8nodejs-packaging0:2021.06-4.module+el8.10.0+1667+4a788d89RLSA-2025:4461
Rocky Linux:8nodejs-packaging0:2021.06-4.module+el8.10.0+1823+b5789597RLSA-2025:4461
Rocky Linux:8nodejs-packaging0:2021.06-4.module+el8.10.0+1924+614dc87fRLSA-2025:4459
Rocky Linux:8nodejs-packaging0:2021.06-4.module+el8.10.0+1988+437f3d23RLSA-2025:4459
Rocky Linux:8nodejs-packaging0:2021.06-4.module+el8.10.0+1989+e60144d9RLSA-2025:4459
Rocky Linux:8nodejs-packaging0:2021.06-4.module+el8.9.0+1419+1f26ef47RLSA-2025:4459
Rocky Linux:8nodejs-packaging0:2021.06-4.module+el8.10.0+1824+532140eeRLSA-2025:4459
Rocky Linux:9nodejs-packaging0:2021.06-4.module+el9.5.0+31786+d18c719dRLSA-2025:7433
Rocky Linux:9nodejs-packaging0:2021.06-4.module+el9.5.0+31770+0da7192dRLSA-2025:7426
Rocky Linux:9nodejs-packaging0:2021.06-4.module+el9.5.0+31786+d18c719dRLSA-2025:7426
Rocky Linux:9nodejs-packaging0:2021.06-4.module+el9.5.0+31770+0da7192dRLSA-2025:7433
Rocky Linux:9nodejs-packaging0:2021.06-4.module+el9.5.0+31785+5534beb0RLSA-2025:7433
Rocky Linux:9nodejs-packaging0:2021.06-4.module+el9.5.0+31785+5534beb0RLSA-2025:7426

Affected products (as reported)

VendorProductVersions
c-ares c-ares >= 1.32.3, < 1.34.5

Weakness: CWE-416 · 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

References