CVEfocus › CVE database › CVE-2025-31498

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

CVSS 8.3 HighEPSS 0.9% (higher than 56% of CVEs)Published 2025-04-08Updated 2025-04-08Assigner: GitHub_M

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.

CWE-416

What to do

Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, Rocky Linux: see the table below for the fixed version per release.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

64Fixed
4Will not fix
9Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04c-aresNot affected
vulnerable_code_not_present
Ubuntu 22.04c-aresNot affected
vulnerable_code_not_present
Debian 14c-aresFixed1.34.5-1DEBIAN-CVE-2025-31498
Debian 13c-aresFixed1.34.5-1DEBIAN-CVE-2025-31498
Red Hat Enterprise Linux 10c-aresNot affected
Red Hat Enterprise Linux 10c-ares-develNot affected
Red Hat Enterprise Linux 10nodejsFixed1:22.15.0-1.el10_0RHSA-2025:7502
Red Hat Enterprise Linux 10nodejs-develFixed1:22.15.0-1.el10_0RHSA-2025:7502
Red Hat Enterprise Linux 10nodejs-docsFixed1:22.15.0-1.el10_0RHSA-2025:7502
Red Hat Enterprise Linux 10nodejs-full-i18nFixed1:22.15.0-1.el10_0RHSA-2025:7502
Red Hat Enterprise Linux 10nodejs-libsFixed1:22.15.0-1.el10_0RHSA-2025:7502
Red Hat Enterprise Linux 10nodejs-npmFixed1:10.9.2-1.22.15.0.1.el10_0RHSA-2025:7502
Red Hat Enterprise Linux 10nodejs22Fixed1:22.15.0-1.el10_0RHSA-2025:7502
Red Hat Enterprise Linux 9c-aresNot affected
Red Hat Enterprise Linux 9c-ares-develNot affected
Red Hat Enterprise Linux 9nodejsFixed1:22.15.0-1.module+el9.6.0+23062+9e7801b9RHSA-2025:7426
Red Hat Enterprise Linux 9nodejs-develFixed1:22.15.0-1.module+el9.6.0+23062+9e7801b9RHSA-2025:7426
Red Hat Enterprise Linux 9nodejs-docsFixed1:20.19.1-1.module+el9.6.0+23053+4195b0b2RHSA-2025:7433
Red Hat Enterprise Linux 9nodejs-full-i18nFixed1:20.19.1-1.module+el9.6.0+23053+4195b0b2RHSA-2025:7433
Red Hat Enterprise Linux 9nodejs-libsFixed1:22.15.0-1.module+el9.6.0+23062+9e7801b9RHSA-2025:7433
Red Hat Enterprise Linux 9nodejs-nodemonFixed0:3.0.1-1.module+el9.6.0+23062+9e7801b9RHSA-2025:7426
Red Hat Enterprise Linux 9nodejs-packagingFixed0:2021.06-4.module+el9.3.0+19518+63aad52dRHSA-2025:7433
Red Hat Enterprise Linux 9nodejs-packaging-bundlerFixed0:2021.06-4.module+el9.6.0+23062+9e7801b9RHSA-2025:7426
Red Hat Enterprise Linux 9npmFixed1:10.8.2-1.20.19.1.1.module+el9.6.0+23053+4195b0b2RHSA-2025:7433
Red Hat Enterprise Linux 9v8-12.4-develFixed3:12.4.254.21-1.22.15.0.1.module+el9.6.0+23062+9e7801b9RHSA-2025:7433
Red Hat Enterprise Linux 8c-aresNot affected
Red Hat Enterprise Linux 8c-ares-develNot affected
Red Hat Enterprise Linux 8nodejsFixed1:22.15.0-1.module+el8.10.0+23068+28ff2340RHSA-2025:4461
Red Hat Enterprise Linux 8nodejs-develFixed1:22.15.0-1.module+el8.10.0+23068+28ff2340RHSA-2025:4461
Red Hat Enterprise Linux 8nodejs-docsFixed1:20.19.1-1.module+el8.10.0+23054+5431297fRHSA-2025:4459
Red Hat Enterprise Linux 8nodejs-full-i18nFixed1:22.15.0-1.module+el8.10.0+23068+28ff2340RHSA-2025:4461
Red Hat Enterprise Linux 8nodejs-libsFixed1:22.15.0-1.module+el8.10.0+23068+28ff2340RHSA-2025:4459
Red Hat Enterprise Linux 8nodejs-nodemonFixed0:3.0.1-1.module+el8.10.0+22904+d0fedeffRHSA-2025:4459
Red Hat Enterprise Linux 8nodejs-packagingFixed0:2021.06-4.module+el8.10.0+23068+28ff2340RHSA-2025:4461
Red Hat Enterprise Linux 8nodejs-packaging-bundlerFixed0:2021.06-4.module+el8.10.0+23068+28ff2340RHSA-2025:4461
Red Hat Enterprise Linux 8npmFixed1:10.8.2-1.20.19.1.1.module+el8.10.0+23054+5431297fRHSA-2025:4459
Red Hat Enterprise Linux 8v8-12.4-develFixed3:12.4.254.21-1.22.15.0.1.module+el8.10.0+23068+28ff2340RHSA-2025:4459
Red Hat Enterprise Linux 8v8-13.6-develNot affected
Red Hat Enterprise Linux 7c-aresWill not fix
Out of support scope
Red Hat Enterprise Linux 7c-ares-develWill not fix
Out of support scope
Red Hat Enterprise Linux 6c-aresWill not fix
Out of support scope
Red Hat Enterprise Linux 6c-ares-develWill not fix
Out of support scope
AlmaLinux 10nodejsFixed1:22.15.0-1.el10_0ALSA-2025:7502
AlmaLinux 10nodejs-develFixed1:22.15.0-1.el10_0ALSA-2025:7502
AlmaLinux 10nodejs-docsFixed1:22.15.0-1.el10_0ALSA-2025:7502
AlmaLinux 10nodejs-full-i18nFixed1:22.15.0-1.el10_0ALSA-2025:7502
AlmaLinux 10nodejs-libsFixed1:22.15.0-1.el10_0ALSA-2025:7502
AlmaLinux 10nodejs-npmFixed1:10.9.2-1.22.15.0.1.el10_0ALSA-2025:7502
AlmaLinux 9nodejsFixed1:20.19.1-1.module_el9.6.0+163+d268fe53ALSA-2025:7433
AlmaLinux 9nodejs-develFixed1:20.19.1-1.module_el9.6.0+163+d268fe53ALSA-2025:7433
AlmaLinux 9nodejs-docsFixed1:20.19.1-1.module_el9.6.0+163+d268fe53ALSA-2025:7433
AlmaLinux 9nodejs-full-i18nFixed1:20.19.1-1.module_el9.6.0+163+d268fe53ALSA-2025:7433
AlmaLinux 9nodejs-libsFixed1:22.15.0-1.module_el9.6.0+164+2d89b8edALSA-2025:7433
AlmaLinux 9nodejs-nodemonFixed3.0.1-1.module_el9.5.0+125+8dc38870ALSA-2025:7433
AlmaLinux 9nodejs-packagingFixed2021.06-4.module_el9.5.0+139+09296491ALSA-2025:7426
AlmaLinux 9nodejs-packaging-bundlerFixed2021.06-4.module_el9.6.0+162+8dc602e5ALSA-2025:7433
AlmaLinux 9npmFixed1:10.9.2-1.22.15.0.1.module_el9.6.0+164+2d89b8edALSA-2025:7426
AlmaLinux 9v8-12.4-develFixed3:12.4.254.21-1.22.15.0.1.module_el9.6.0+164+2d89b8edALSA-2025:7433
AlmaLinux 8nodejsFixed1:22.15.0-1.module_el8.10.0+3986+a908e756ALSA-2025:4461
AlmaLinux 8nodejs-develFixed1:20.19.1-1.module_el8.10.0+3987+dbda4426ALSA-2025:4459
AlmaLinux 8nodejs-docsFixed1:20.19.1-1.module_el8.10.0+3987+dbda4426ALSA-2025:4459
AlmaLinux 8nodejs-full-i18nFixed1:22.15.0-1.module_el8.10.0+3986+a908e756ALSA-2025:4461
AlmaLinux 8nodejs-libsFixed1:22.15.0-1.module_el8.10.0+3986+a908e756ALSA-2025:4459
AlmaLinux 8nodejs-nodemonFixed3.0.1-1.module_el8.10.0+3983+391a1a04ALSA-2025:4461
AlmaLinux 8nodejs-packagingFixed2021.06-4.module_el8.10.0+3961+6a788e57ALSA-2025:4461
AlmaLinux 8nodejs-packaging-bundlerFixed2021.06-4.module_el8.10.0+3961+6a788e57ALSA-2025:4461
AlmaLinux 8npmFixed1:10.8.2-1.20.19.1.1.module_el8.10.0+3987+dbda4426ALSA-2025:4459
AlmaLinux 8v8-12.4-develFixed3:12.4.254.21-1.22.15.0.1.module_el8.10.0+3986+a908e756ALSA-2025:4459
Rocky Linux 9nodejs-nodemonFixed0:3.0.1-1.module+el9.5.0+31770+0da7192dRLSA-2025:7433
Rocky Linux 9nodejs-packagingFixed0:2021.06-4.module+el9.5.0+31785+5534beb0RLSA-2025:7433
Rocky Linux 8nodejsFixed1:22.15.0-1.module+el8.10.0+1971+0bb08eceRLSA-2025:4461
Rocky Linux 8nodejs-nodemonFixed0:3.0.1-1.module+el8.10.0+1988+437f3d23RLSA-2025:4459
Rocky Linux 8nodejs-packagingFixed0:2021.06-4.module+el8.10.0+1924+614dc87fRLSA-2025:4461
Alpine Linux 3.24c-aresFixed1.34.5-r0ALPINE-CVE-2025-31498
Alpine Linux 3.23c-aresFixed1.34.5-r0ALPINE-CVE-2025-31498
Alpine Linux 3.22c-aresFixed1.34.5-r0ALPINE-CVE-2025-31498
Alpine Linux 3.21c-aresFixed1.34.5-r0ALPINE-CVE-2025-31498

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.