CVE-2025-31498: 
npm vulnerability analysis and mitigation

Overview

CVE-2025-31498 affects c-ares, an asynchronous resolver library, versions 1.32.3 through 1.34.4. The vulnerability is a use-after-free issue in the read_answers() function when process_answer() may re-enqueue a query due to DNS Cookie Failure, upstream server EDNS incompatibility, or TCP query connection closure. The vulnerability was discovered by Erik Lax and was patched in version 1.34.5 (GitHub Advisory).

Technical details

The vulnerability occurs when a connection handle is closed due to transaction issues, but read_answers() continues to expect the handle to be available for dequeuing responses. This creates a use-after-free condition in the DNS resolution process. The issue has been assigned a CVSSv4 score of 8.3 (High), with attack vector being Network and attack complexity being High (GitHub Advisory, Security Online).

Impact

The vulnerability could potentially lead to system crashes or possible code execution. The impact metrics indicate Low impact on confidentiality and integrity, but High impact on availability of the vulnerable system. The vulnerability affects the core DNS resolution functionality, which could disrupt network operations for applications using the c-ares library (GitHub Advisory).

Exploitability

Remote exploitation is theoretically possible if an attacker can flood the target with ICMP UNREACHABLE packets while controlling the upstream nameserver. However, this attack vector remains untested. Local attackers have a more straightforward path by manipulating system behavior to cause send()/write() failure conditions (Openwall, Security Online).

Mitigation and workarounds

The vulnerability has been fixed in c-ares version 1.34.5. Users should upgrade to this version immediately. For those unable to upgrade immediately, there are no known workarounds. Specific patches are available for different versions: 1.34 patches, 1.33 patches, and 1.32 patches through the official repository (GitHub Advisory).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

c-ares

Fixed

sid

c-ares: 1.34.5-1

Fixed

trixie

c-ares: 1.34.5-1

Fixed

RHEL / CentOS

Fixed

OpenShift

Not Affected

RHEL 8

:appstream:nodejs-0:20-8100020250425153222.489197e6.src

Fixed

RHEL 9

:appstream:nodejs:20/nodejs/nodejs-0:20.18.2-2.module%2Bel9.4.0%2B23089%2Baaa18a20

Fixed

RHEL 10

nodejs22-1:22.15.0-1.el10_0.src

Fixed

Alpine

Fixed

edge

c-ares: 1.34.5-r0

Fixed

v3.21

c-ares: 1.34.5-r0

Fixed

v3.22

c-ares: 1.34.5-r0

Fixed

v3.23

c-ares: 1.34.5-r0

Fixed

Source: This report was generated using AI

Related npm vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-19534HIGH7.5
  • Grafana logoGrafana
  • ubi8::nodejs-24
NoYesSep 04, 2026
CVE-2026-73566HIGH7.5
  • JavaScript logoJavaScript
  • node-tar
NoYesAug 13, 2026
CVE-2026-56848HIGH7.5
  • npm logonpm
  • cpe:2.3:a:nodejs:node.js
NoYesAug 04, 2026
CVE-2026-58045MEDIUM6.2
  • npm logonpm
  • nodejs22::nodejs-libs
NoYesAug 04, 2026
CVE-2026-58044LOW3.7
  • npm logonpm
  • nodejs18-devel
NoYesAug 04, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management