CVE-2023-31147
npm vulnerability analysis and mitigation

Overview

CVE-2023-31147 affects c-ares, an asynchronous resolver library. The vulnerability was discovered in May 2023 and fixed in version 1.19.1. The issue occurs when /dev/urandom or RtlGenRandom() are unavailable, causing c-ares to use rand() to generate random numbers for DNS query IDs, leading to insufficient randomness in the generation process (GitHub Advisory).

Technical details

The vulnerability has a CVSS v3.1 base score of 5.9 (Moderate) with vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N. The technical issue involves three main components: 1) The use of unseeded rand() function for generating DNS query IDs when primary random sources are unavailable, 2) A non-compliant RC4 implementation that may not provide the same strength as the original RC4 implementation, and 3) Lack of support for modern OS-provided CSPRNGs like arc4random() (GitHub Advisory, OSS Security).

Impact

The vulnerability could lead to predictable DNS query IDs due to insufficient randomness in their generation. This weakness potentially allows attackers to predict query IDs, which could facilitate DNS spoofing attacks (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been fixed in c-ares version 1.19.1. The fix includes: detecting and using arc4random() when available, using /dev/urandom or RtlGenRandom() directly as a fallback, and improving the last-resort rand() + RC4 logic by implementing the official RC4 algorithm and properly seeding rand() with srand(). No workarounds are available for unpatched systems (GitHub Release, GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related npm vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-64756HIGH7.5
  • JavaScriptJavaScript
  • nodejs:22::npm
NoYesNov 17, 2025
CVE-2025-6965HIGH7.2
  • SQLiteSQLite
  • rust-analyzer
NoYesJul 15, 2025
CVE-2025-7458MEDIUM6.9
  • SQLiteSQLite
  • nodejs:22::v8-12.4-devel
NoYesJul 29, 2025
CVE-2025-64118MEDIUM6.1
  • JavaScriptJavaScript
  • kibana-9.2
NoYesOct 30, 2025
CVE-2025-52099N/AN/A
  • SQLiteSQLite
  • mingw32-sqlite-static
NoYesOct 24, 2025

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