Skip to content
OpenAdvisories
High · 8.3 CVE-2025-31498 EUVD-2025-10377

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

Published Apr 8, 2025 · Updated Apr 8, 2025 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
c-ares c-ares >= 1.32.3, < 1.34.5 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 c-ares 1.34.5-1 —
Debian 13 c-ares 1.34.5-1 —
ReleasePackageFixed inAdvisory
Ubuntu 25.04 c-ares 1.34.4-2.1ubuntu0.1 USN-7477-1
ReleasePackageFixed inAdvisory
RHEL 10 nodejs +5 1:22.15.0-1.el10_0 RHSA-2025:7502
RHEL 10 nodejs-npm 1:10.9.2-1.22.15.0.1.el10_0 RHSA-2025:7502
RHEL 9 nodejs +3 1:20.19.1-1.module+el9.6.0+23053+4195b0b2 RHSA-2025:7433, RHSA-2025:7426
RHEL 9 nodejs-libs 1:22.15.0-1.module+el9.6.0+23062+9e7801b9 RHSA-2025:7433
RHEL 9 nodejs-nodemon 3.0.1-1.module+el9.3.0.z+20478+84a9f781 RHSA-2025:7433, RHSA-2025:7426
RHEL 9 nodejs-packaging +1 2021.06-4.module+el9.3.0+19518+63aad52d RHSA-2025:7433, RHSA-2025:7426
RHEL 9 npm 1:10.8.2-1.20.19.1.1.module+el9.6.0+23053+4195b0b2 RHSA-2025:7433, RHSA-2025:7426
RHEL 9 v8-12.4-devel 3:12.4.254.21-1.22.15.0.1.module+el9.6.0+23062+9e7801b9 RHSA-2025:7433
RHEL 8 nodejs +3 1:20.19.1-1.module+el8.10.0+23054+5431297f RHSA-2025:4461, RHSA-2025:4459
RHEL 8 nodejs-libs 1:22.15.0-1.module+el8.10.0+23068+28ff2340 RHSA-2025:4459
RHEL 8 nodejs-nodemon 3.0.1-1.module+el8.10.0+22904+d0fedeff RHSA-2025:4461, RHSA-2025:4459
RHEL 8 nodejs-packaging +1 2021.06-4.module+el8.10.0+22904+d0fedeff RHSA-2025:4461, RHSA-2025:4459
RHEL 8 npm 1:10.8.2-1.20.19.1.1.module+el8.10.0+23054+5431297f RHSA-2025:4461, RHSA-2025:4459
RHEL 8 v8-12.4-devel 3:12.4.254.21-1.22.15.0.1.module+el8.10.0+23068+28ff2340 RHSA-2025:4459
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
RHEL 9.4 EUS nodejs +3 1:20.18.2-2.module+el9.4.0+23089+aaa18a20 RHSA-2025:7537
RHEL 9.4 EUS nodejs-nodemon 3.0.1-1.module+el9.3.0.z+20478+84a9f781 RHSA-2025:7537
RHEL 9.4 EUS nodejs-packaging +1 2021.06-4.module+el9.3.0+19518+63aad52d RHSA-2025:7537
RHEL 9.4 EUS npm 1:10.8.2-1.20.18.2.2.module+el9.4.0+23089+aaa18a20 RHSA-2025:7537

AlmaLinux

Errata ↗
ReleasePackageFixed inAdvisory
AlmaLinux 10 nodejs +4 1:22.15.0-1.el10_0 ALSA-2025:7502
AlmaLinux 10 nodejs-npm 1:10.9.2-1.22.15.0.1.el10_0 ALSA-2025:7502
AlmaLinux 9 nodejs +3 1:20.19.1-1.module_el9.6.0+163+d268fe53 ALSA-2025:7433, ALSA-2025:7426
AlmaLinux 9 nodejs-libs 1:22.15.0-1.module_el9.6.0+164+2d89b8ed ALSA-2025:7433
AlmaLinux 9 nodejs-nodemon 3.0.1-1.module_el9.5.0+125+8dc38870 ALSA-2025:7433, ALSA-2025:7426
AlmaLinux 9 nodejs-packaging +1 2021.06-4.module_el9.5.0+139+09296491 ALSA-2025:7433, ALSA-2025:7426
AlmaLinux 9 npm 1:10.8.2-1.20.19.1.1.module_el9.6.0+163+d268fe53 ALSA-2025:7433, ALSA-2025:7426
AlmaLinux 9 v8-12.4-devel 3:12.4.254.21-1.22.15.0.1.module_el9.6.0+164+2d89b8ed ALSA-2025:7433
AlmaLinux 8 nodejs +3 1:20.19.1-1.module_el8.10.0+3987+dbda4426 ALSA-2025:4461, ALSA-2025:4459
AlmaLinux 8 nodejs-libs 1:22.15.0-1.module_el8.10.0+3986+a908e756 ALSA-2025:4459
AlmaLinux 8 nodejs-nodemon 3.0.1-1.module_el8.10.0+3982+85c136aa ALSA-2025:4461, ALSA-2025:4459
AlmaLinux 8 nodejs-packaging 2021.06-4.module_el8.10.0+3961+6a788e57 ALSA-2025:4461, ALSA-2025:4459
AlmaLinux 8 nodejs-packaging-bundler 2021.06-4.module_el8.10.0+3958+472a6467 ALSA-2025:4461, ALSA-2025:4459
AlmaLinux 8 npm 1:10.8.2-1.20.19.1.1.module_el8.10.0+3987+dbda4426 ALSA-2025:4461, ALSA-2025:4459
AlmaLinux 8 v8-12.4-devel 3:12.4.254.21-1.22.15.0.1.module_el8.10.0+3986+a908e756 ALSA-2025:4459

Rocky Linux

Errata ↗
ReleasePackageFixed inAdvisory
Rocky Linux 9 nodejs-nodemon 3.0.1-1.module+el9.5.0+31770+0da7192d RLSA-2025:7433, RLSA-2025:7426
Rocky Linux 9 nodejs-packaging 2021.06-4.module+el9.5.0+31770+0da7192d RLSA-2025:7433, RLSA-2025:7426
Rocky Linux 8 nodejs 1:20.19.1-1.module+el8.10.0+1972+57cf735f RLSA-2025:4461, RLSA-2025:4459
Rocky Linux 8 nodejs-nodemon 3.0.1-1.module+el8.9.0+1760+903d54b9 RLSA-2025:4461, RLSA-2025:4459
Rocky Linux 8 nodejs-packaging 2021.06-4.module+el8.9.0+1419+1f26ef47 RLSA-2025:4461, RLSA-2025:4459
ReleasePackageFixed inAdvisory
SLES 15 SP7 c-ares 1.34.8-150000.3.29.1 SUSE-SU-2026:4021-1
SLES 15 SP6 c-ares 1.34.8-150000.3.29.1 SUSE-SU-2026:4021-1
SLES 15 SP5 c-ares 1.34.8-150000.3.29.1 SUSE-SU-2026:4021-1
SLES 15 SP4 c-ares 1.34.8-150000.3.29.1 SUSE-SU-2026:4021-1
Show 10 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 15 SP6 c-ares 1.34.8-150000.3.29.1 SUSE-SU-2026:4021-1
SLES for SAP 15 SP5 c-ares 1.34.8-150000.3.29.1 SUSE-SU-2026:4021-1
SLES for SAP 15 SP4 c-ares 1.34.8-150000.3.29.1 SUSE-SU-2026:4021-1
SLE Micro 6.1 c-ares 1.34.8-slfo.1.1_1.1 SUSE-SU-2026:23414-1
SLE Micro 6.0 c-ares 1.34.8-1.1 SUSE-SU-2026:23364-1
SLE Micro 5.5 c-ares 1.34.8-150000.3.29.1 SUSE-SU-2026:4021-1
SLE Micro 5.4 c-ares 1.34.8-150000.3.29.1 SUSE-SU-2026:4021-1
SLE Micro 5.3 c-ares 1.34.8-150000.3.29.1 SUSE-SU-2026:4021-1
SLE HPC 15 SP5 c-ares 1.34.8-150000.3.29.1 SUSE-SU-2026:4021-1
SLE HPC 15 SP4 c-ares 1.34.8-150000.3.29.1 SUSE-SU-2026:4021-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed c-ares 1.34.5-1.1 openSUSE-SU-2025:14977-1
ReleasePackageFixed inAdvisory
Alpine v3.24 c-ares 1.34.5-r0 —
Alpine v3.23 c-ares 1.34.5-r0 —
Alpine v3.22 c-ares 1.34.5-r0 —
Alpine v3.21 c-ares 1.34.5-r0 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 nodejs20 +4 1:20.19.0-1.amzn2023.0.1 ALAS2023-2025-942
Amazon Linux 2023 nodejs20-npm 1:10.8.2-1.20.19.0.1.amzn2023.0.1 ALAS2023-2025-942
Amazon Linux 2023 v8-11.3-devel 3:11.3.244.8-1.20.19.0.1.amzn2023.0.1 ALAS2023-2025-942

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 3 fluent-bit 3.1.9-4 —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 10 nodejs +4 1:22.16.0-1.el10_0 ELSA-2025-7502
Oracle Linux 10 nodejs-npm 1:10.9.2-1.22.16.0.1.el10_0 ELSA-2025-7502
Oracle Linux 9 nodejs +3 1:20.19.1-1.module+el9.6.0+90590+fd42b52a ELSA-2025-7433, ELSA-2025-7426
Oracle Linux 9 nodejs-libs 1:22.15.0-1.module+el9.6.0+90588+1a9ecb62 ELSA-2025-7433
Oracle Linux 9 nodejs-nodemon 3.0.1-1.module+el9.3.0+90066+12d4a8d7 ELSA-2025-7433, ELSA-2025-7426
Oracle Linux 9 nodejs-packaging +1 2021.06-4.module+el9.3.0+90066+12d4a8d7 ELSA-2025-7433, ELSA-2025-7426
Oracle Linux 9 npm 1:10.8.2-1.20.19.1.1.module+el9.6.0+90590+fd42b52a ELSA-2025-7433, ELSA-2025-7426
Oracle Linux 9 v8-12.4-devel 3:12.4.254.21-1.22.15.0.1.module+el9.6.0+90588+1a9ecb62 ELSA-2025-7433
Oracle Linux 8 nodejs +3 1:20.19.1-1.module+el8.10.0+90560+49d7a1eb ELSA-2025-4461, ELSA-2025-4459
Oracle Linux 8 nodejs-libs 1:22.15.0-1.module+el8.10.0+90558+f3d29a46 ELSA-2025-4459
Oracle Linux 8 nodejs-nodemon 3.0.1-1.module+el8.10.0+90558+f3d29a46 ELSA-2025-4461, ELSA-2025-4459
Oracle Linux 8 nodejs-packaging +1 2021.06-4.module+el8.10.0+90558+f3d29a46 ELSA-2025-4461, ELSA-2025-4459
Oracle Linux 8 npm 1:10.8.2-1.20.19.1.1.module+el8.10.0+90560+49d7a1eb ELSA-2025-4461, ELSA-2025-4459
Oracle Linux 8 v8-12.4-devel 3:12.4.254.21-1.22.15.0.1.module+el8.10.0+90558+f3d29a46 ELSA-2025-4459

Advisories 28

References