CVE-2023-31147 | Insufficient randomness in generation of DNS query IDs in c-ares

c-ares is an asynchronous resolver library. When /dev/urandom or RtlGenRandom() are unavailable, c-ares uses rand() to generate random numbers used for DNS query ids. This is not a CSPRNG, and it is also not seeded by srand() so will generate predictable output. Input from the random number generator is fed into a non-compilant RC4 implementation and may not be as strong as the original RC4 implementation. No attempt is made to look for modern OS-provided CSPRNGs like arc4random() that is widely available. This issue has been fixed in version 1.19.1.

Published: 2023-05-25 Last update: 2026-06-17 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2023-31147 is rated Moderate Risk (43.7/100): CVSS Medium severity, with medium exploitation likelihood (EPSS 0.91%). Mandatory action: Review affected assets and schedule remediation.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2023-31147

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-06-15 0.09% 0.91% +0.82%
2 2025-11-21 0.33% 0.09% -0.24%
3 2025-11-18 0.33%

Full EPSS history (10 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2023-31147

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
5.9 3.1 MEDIUM
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:N)
Doesn’t really leak secrets in a meaningful way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:N)
Service keeps running; no real outage angle.
2.2 3.6 [email protected]
6.5 3.1 MEDIUM
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:L)
Some sensitive info could get out, but not a total data dump.
Integrity (I:L)
Attackers could change some data, but it’s limited—not everything goes.
Availability (A:N)
Service keeps running; no real outage angle.
3.9 2.5 [email protected]

Weakness enumeration for CVE-2023-31147

OS Trackers for CVE-2023-31147

vendor priority summary link
alpine medium CVE-2023-31147: 1 source package rows (c-ares); 5 state rows across 5 repos (3.19-main, 3.20-main, 3.21-main, 3.22-main, edge-main); fixed 0, open 5. https://security.alpinelinux.org/vuln/CVE-2023-31147
debian unimportant CVE-2023-31147 unimportant priority: Debian including 1 source packages (c-ares), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 3, open 2. https://security-tracker.debian.org/tracker/CVE-2023-31147
gentoo normal CVE-2023-31147: 1 GLSA(s) (202310-09), 1 atom(s) (net-dns/c-ares); latest impact normal. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2023-31147
redhat medium https://access.redhat.com/security/cve/CVE-2023-31147
suse medium CVE-2023-31147 severity moderate: SUSE including 305 source package names (0.3.2-1.2:libcares2-1.19.1-150000.3.23.1, 0.3.32-3.4:libcares2-1.19.1-150000.3.23.1, …), 690 product×package rows across 317 product lines (Container bci/nodejs, Container caasp/v4/cilium, … (317 product lines)): Fixed 538, Known Affected 152. https://www.suse.com/security/cve/CVE-2023-31147/
ubuntu negligible CVE-2023-31147 negligible priority: Ubuntu including 1 source packages (c-ares), 8 status rows across 8 suites (bionic, focal, jammy, kinetic, lunar, trusty, upstream, xenial): not-affected 6, ignored 1, released 1. https://ubuntu.com/security/CVE-2023-31147

Affected software / configurations for CVE-2023-31147

Vendor Product Version Raw CPE
c-ares_project c-ares < 1.19.1 cpe:2.3:a:c-ares_project:c-ares:*:*:*:*:*:*:*:*
fedoraproject fedora 37 cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:*
fedoraproject fedora 38 cpe:2.3:o:fedoraproject:fedora:38:*:*:*:*:*:*:*

References for CVE-2023-31147

cvelogic Threat Intelligence