# CVE-2025-31498: c-ares has a use-after-free in read\_answers()

- Priority: **Prioritise**
- Reason: Severe, CVSS 8.3 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 1% (FIRST, 04-12-2026)
- Next step: Check applicability: affected before 1.34.5 (CNA); fix release not confirmed
- Status: published
- Published: 2025-04-08 · Modified: 2025-04-08
- Aliases: ALPINE-CVE-2025-31498, RHSA-2025:4461, RHSA-2025:7426, RHSA-2025:7502, RHSA-2025:7537, UBUNTU-CVE-2025-31498, USN-7477-1, DEBIAN-CVE-2025-31498, openSUSE-SU-2025:14977-1
- Record: https://cvemate.com/vulnerability/CVE-2025-31498 · JSON: https://cvemate.com/vulnerability/CVE-2025-31498/json

## Description

```text
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.
```

## Signals

- CVSS: 8.3 high (v4.0, CVE.org) 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.602%, percentile 50.24%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 21)

- alpine c-ares (Alpine Linux): \< 1.34.5-r0
- c-ares c-ares: ≥ 1.32.3, \< 1.34.5
- debian c-ares (Debian): \< 1.34.5-1
- ubuntu c-ares (Ubuntu): \< 1.34.4-2.1ubuntu0.1
- opensuse c-ares&distro=openSUSE Tumbleweed (openSUSE): \< 1.34.5-1.1
- redhat nodejs (Red Hat): \< 1:20.19.1-1.module+el8.10.0+23054+5431297f \| \< 1:20.19.1-1.module+el9.6.0+23053+4195b0b2 \| \< 1:22.15.0-1.el10\_0 \| \< 1:20.18.2-2.module+el9.4.0+23089+aaa18a20
- redhat nodejs-debuginfo (Red Hat): \< 1:20.19.1-1.module+el8.10.0+23054+5431297f \| \< 1:20.19.1-1.module+el9.6.0+23053+4195b0b2 \| \< 1:22.15.0-1.el10\_0 \| \< 1:20.18.2-2.module+el9.4.0+23089+aaa18a20
- redhat nodejs-debugsource (Red Hat): \< 1:20.19.1-1.module+el8.10.0+23054+5431297f \| \< 1:20.19.1-1.module+el9.6.0+23053+4195b0b2 \| \< 1:20.18.2-2.module+el9.4.0+23089+aaa18a20
- redhat nodejs-devel (Red Hat): \< 1:20.19.1-1.module+el8.10.0+23054+5431297f \| \< 1:20.19.1-1.module+el9.6.0+23053+4195b0b2 \| \< 1:22.15.0-1.el10\_0 \| \< 1:20.18.2-2.module+el9.4.0+23089+aaa18a20
- redhat nodejs-docs (Red Hat): \< 1:20.19.1-1.module+el8.10.0+23054+5431297f \| \< 1:20.19.1-1.module+el9.6.0+23053+4195b0b2 \| \< 1:22.15.0-1.el10\_0 \| \< 1:20.18.2-2.module+el9.4.0+23089+aaa18a20
- redhat nodejs-full-i18n (Red Hat): \< 1:20.19.1-1.module+el8.10.0+23054+5431297f \| \< 1:20.19.1-1.module+el9.6.0+23053+4195b0b2 \| \< 1:22.15.0-1.el10\_0 \| \< 1:20.18.2-2.module+el9.4.0+23089+aaa18a20
- redhat nodejs-libs (Red Hat): \< 1:22.15.0-1.el10\_0
- redhat nodejs-libs-debuginfo (Red Hat): \< 1:22.15.0-1.el10\_0
- redhat nodejs-nodemon (Red Hat): \< 0:3.0.1-1.module+el8.10.0+22904+d0fedeff \| \< 0:3.0.1-1.module+el9.3.0.z+20478+84a9f781
- redhat nodejs-npm (Red Hat): \< 1:10.9.2-1.22.15.0.1.el10\_0
- redhat nodejs-packaging (Red Hat): \< 0:2021.06-4.module+el8.10.0+22904+d0fedeff \| \< 0:2021.06-4.module+el9.3.0+19518+63aad52d
- redhat nodejs-packaging-bundler (Red Hat): \< 0:2021.06-4.module+el8.10.0+22904+d0fedeff \| \< 0:2021.06-4.module+el9.3.0+19518+63aad52d
- redhat nodejs22 (Red Hat): \< 1:22.15.0-1.el10\_0
- redhat nodejs22-debuginfo (Red Hat): \< 1:22.15.0-1.el10\_0
- redhat nodejs22-debugsource (Red Hat): \< 1:22.15.0-1.el10\_0

## References (first 20 of 23)

- <https://github.com/c-ares/c-ares/security/advisories/GHSA-6hxc-62jh-p29v>
- <https://github.com/c-ares/c-ares/pull/821>
- <https://github.com/c-ares/c-ares/commit/29d38719112639d8c0ba910254a3dd4f482ea2d1>
- <http://www.openwall.com/lists/oss-security/2025/04/08/3>
- <https://security.alpinelinux.org/vuln/CVE-2025-31498>
- <https://access.redhat.com/errata/RHSA-2025:4461>
- <https://access.redhat.com/security/updates/classification/#moderate>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2358271>
- <https://issues.redhat.com/browse/RHEL-78763>
- <https://security.access.redhat.com/data/csaf/v2/advisories/2025/rhsa-2025_4461.json>
- <https://access.redhat.com/security/cve/CVE-2025-31498>
- <https://www.cve.org/CVERecord?id=CVE-2025-31498>
- <https://nvd.nist.gov/vuln/detail/CVE-2025-31498>
- <https://access.redhat.com/errata/RHSA-2025:7426>
- <https://security.access.redhat.com/data/csaf/v2/advisories/2025/rhsa-2025_7426.json>
- <https://access.redhat.com/errata/RHSA-2025:7502>
- <https://security.access.redhat.com/data/csaf/v2/advisories/2025/rhsa-2025_7502.json>
- <https://access.redhat.com/errata/RHSA-2025:7537>
- <https://security.access.redhat.com/data/csaf/v2/advisories/2025/rhsa-2025_7537.json>
- <https://ubuntu.com/security/CVE-2025-31498>

---

Data as of 2026-12-05T09:19:32.241Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
