Skip to content
NewA calmer, faster ZeroHour
Vulnerability6 · 1 read

CVE-2026-84897

Unauthenticated CPU DoS in wolfSSH Server via DH Group Exchange Messages

CVSS 4.0
6.9 medium
EPSS
—
Published
·
Modified
Analyze CVE-2026-84897 with Vani AIImpact, affected versions, exploitation status, mitigations and detection

wolfSSH's IsMessageAllowedServer() in src/internal.c applies no direction check to key exchange message IDs 30-34, so an unauthenticated client can send server-to-client messages that a server should never accept. By negotiating diffie-hellman-group-exchange-sha256 and then sending SSH_MSG_KEX_DH_GEX_GROUP (31), the client tricks the server into running the client-role handler DoKexDhGexGroup(), which performs two 8-round Miller-Rabin primality tests on attacker-supplied values of up to 8192 bits, generates a DH key pair in the attacker's group, and replies with SSH_MSG_KEX_DH_GEX_INIT (32). This yields a low-overhead CPU denial-of-service on the server, since published RFC 3526 safe primes are free for the attacker to obtain and are the worst-case input. The primality-check cost applies to 1.5.0 (where validation was added); versions 1.2.0 through 1.4.22 admit the same message and enter the same client-role path without the primality cost. There is no known public PoC or in-the-wild exploitation, and the issue is not on the CISA KEV list; a fixed release (1.6.0) has shipped alongside other wolfSSH security fixes.

What to do: Upgrade to wolfSSH 1.6.0, the release that ships security fixes including this one. If upgrading is not immediately possible, rebuild with WOLFSSH_NO_DH_GEX_SHA256 (or WOLFSSH_NO_DH / NO_SHA256) to compile out the affected code path, or restrict key exchange negotiation to exclude diffie-hellman-group-exchange-sha256. Watch for unauthenticated clients causing sustained CPU spikes on SSH endpoints, which would indicate attempted exploitation.

ProductAffected
wolfSSL wolfSSH1.5.0 (primality-test DoS cost); 1.2.0 through 1.4.22 (same message admitted, client-role path entered without primality cost); described as affecting wolfSSH t
Estimated exposure
unknown — plausibly thousands to tens of thousands of embedded devices, but not reliably countable — wolfSSH is an SSH server library compiled into embedded/IoT and industrial firmware rather than a standalone installable product, and its SSH banners are not distinguishable in public internet scans, so there is no solid count of exposed…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description · NVD

src/internal.c in wolfSSL wolfSSH through 1.5.0 admits the server-to-client Diffie-Hellman group exchange messages SSH_MSG_KEX_DH_GEX_GROUP (31) and SSH_MSG_KEX_DH_GEX_REPLY (33) when a server receives them from an unauthenticated client. IsMessageAllowedServer() applies no direction check to the key exchange message range: when the peer is keying and no particular message is expected, which is the state a server is in for the whole window after it processes the client's KEXINIT because nothing sets handshake->expectMsgId there, the function falls out of its expectation branch without a verdict and reaches a numeric bound that admits every message id from 30 through 34. A client that negotiates diffie-hellman-group-exchange-sha256 and then sends message 31 makes the server run the client-side handler DoKexDhGexGroup(), which validates the attacker-supplied group with two 8-round Miller-Rabin primality tests, one on p and one on (p-1)/2, on a value of up to 8192 bits. The handler then returns success: the server stores the attacker's prime and generator, generates a Diffie-Hellman key pair in the attacker's group, and sends the client-role message SSH_MSG_KEX_DH_GEX_INIT (32) back to the attacker. Published RFC 3526 safe primes are the worst-case input and cost the attacker nothing to obtain. The primality validation was added in 1.5.0; versions from 1.2.0 through 1.4.22 admit the same message and enter the same client-role path without the primality cost. Message 33 is admitted as well, but on a server it is rejected before any cryptography because no public key check callback is registered, so it carries no comparable cost. Builds that define WOLFSSH_NO_DH_GEX_SHA256, which is implied by WOLFSSH_NO_DH or NO_SHA256, are unaffected.

Vendors
wolfssh
Products
wolfssh
Weakness
CWE-372, CWE-400, CWE-405
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:Y/R:X/V:X/RE:X/U:X

In the news

2 stories