{"api_version":"1","generated_at":"2026-10-21T17:39:18+00:00","cve":"CVE-2026-84897","urls":{"html":"https://cve.report/CVE-2026-84897","api":"https://cve.report/api/cve/CVE-2026-84897.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-84897","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-84897"},"summary":{"title":"wolfSSH server accepts server-to-client DH group exchange messages from an unauthenticated client, causing pre-authentication primality-test CPU exhaustion and key exchange role confusion","description":"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.","state":"PUBLISHED","assigner":"wolfSSL","published_at":"2026-10-07 03:17:00","updated_at":"2026-10-13 14:27:11"},"problem_types":["CWE-372","CWE-400","CWE-405","CWE-372 CWE-372 Incomplete Internal State Distinction","CWE-405 CWE-405 Asymmetric Resource Consumption (Amplification)","CWE-400 CWE-400 Uncontrolled Resource Consumption"],"metrics":[{"version":"4.0","source":"facts@wolfssl.com","type":"Secondary","score":"6.9","severity":"MEDIUM","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","data":{"version":"4.0","vectorString":"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","baseScore":6.9,"baseSeverity":"MEDIUM","attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnAvailabilityImpact":"LOW","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","confidentialityRequirement":"NOT_DEFINED","integrityRequirement":"NOT_DEFINED","availabilityRequirement":"NOT_DEFINED","modifiedAttackVector":"NOT_DEFINED","modifiedAttackComplexity":"NOT_DEFINED","modifiedAttackRequirements":"NOT_DEFINED","modifiedPrivilegesRequired":"NOT_DEFINED","modifiedUserInteraction":"NOT_DEFINED","modifiedVulnConfidentialityImpact":"NOT_DEFINED","modifiedVulnIntegrityImpact":"NOT_DEFINED","modifiedVulnAvailabilityImpact":"NOT_DEFINED","modifiedSubConfidentialityImpact":"NOT_DEFINED","modifiedSubIntegrityImpact":"NOT_DEFINED","modifiedSubAvailabilityImpact":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"YES","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED"}},{"version":"4.0","source":"CNA","type":"CVSS","score":"6.9","severity":"MEDIUM","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/AU:Y","data":{"Automatable":"YES","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"LOW","attackRequirements":"NONE","attackVector":"NETWORK","baseScore":6.9,"baseSeverity":"MEDIUM","exploitMaturity":"NOT_DEFINED","privilegesRequired":"NONE","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","userInteraction":"NONE","valueDensity":"NOT_DEFINED","vectorString":"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/AU:Y","version":"4.0","vulnAvailabilityImpact":"LOW","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnerabilityResponseEffort":"NOT_DEFINED"}},{"version":"3.1","source":"nvd@nist.gov","type":"Primary","score":"5.3","severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","data":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","baseScore":5.3,"baseSeverity":"MEDIUM","attackVector":"NETWORK","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"NONE","integrityImpact":"NONE","availabilityImpact":"LOW"}}],"references":[{"url":"https://www.rfc-editor.org/rfc/rfc3526.html","name":"https://www.rfc-editor.org/rfc/rfc3526.html","refsource":"facts@wolfssl.com","tags":["Technical Description"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://github.com/wolfSSL/wolfssh/commit/a472f1ee2b653f623d85ef2297321733f1dbfd22","name":"https://github.com/wolfSSL/wolfssh/commit/a472f1ee2b653f623d85ef2297321733f1dbfd22","refsource":"facts@wolfssl.com","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://github.com/wolfSSL/wolfssh/pull/1221","name":"https://github.com/wolfSSL/wolfssh/pull/1221","refsource":"facts@wolfssl.com","tags":["Patch"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.rfc-editor.org/rfc/rfc4419.html","name":"https://www.rfc-editor.org/rfc/rfc4419.html","refsource":"facts@wolfssl.com","tags":["Technical Description"],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-84897","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-84897","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"wolfSSL Inc.","product":"wolfSSH","version":"affected 1.2.0 1.5.0 semver","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[{"source":"CNA","title":"","value":"Build wolfSSH with WOLFSSH_NO_DH_GEX_SHA256 defined so that diffie-hellman-group-exchange-sha256 is neither offered nor accepted, which removes the message 31 dispatch path entirely. Where group exchange must stay available, lowering WOLFSSH_DEFAULT_GEXDH_MAX reduces the size of the value a peer can submit for primality testing and so the cost of a single packet, but it does not stop a server from accepting the message.","time":"","lang":"en"}],"exploits":[],"credits":[{"source":"CNA","value":"Abdullah Al Ishtiaq, Kai Tu, Matthew Carter, Xiaotian Zhou, Ananna Rahman, Yilu Dong, Tianwei Yu, Ali Ranjbar, Syed Rafiul Hussain","lang":"en"}],"nvd_cpes":[{"cve_year":"2026","cve_id":"84897","vulnerable":"1","versionEndIncluding":"","cpe1":"cpe","cpe2":"2.3","cpe3":"a","cpe4":"wolfssh","cpe5":"wolfssh","cpe6":"*","cpe7":"*","cpe8":"*","cpe9":"*","cpe10":"*","cpe11":"*","cpe12":"*","cpe13":"*"}],"vendor_comments":[],"enrichments":{"kev":null,"epss":{"cve_year":"2026","cve_id":"84897","cve":"CVE-2026-84897","epss":"0.003010000","percentile":"0.209390000","score_date":"2026-10-07","updated_at":"2026-10-08 00:05:46"},"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"adp":[{"metrics":[{"other":{"content":{"id":"CVE-2026-84897","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","timestamp":"2026-10-07T18:36:45.750446Z","version":"2.0.3"},"type":"ssvc"}}],"providerMetadata":{"dateUpdated":"2026-10-07T18:37:00.316Z","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","shortName":"CISA-ADP"},"title":"CISA ADP Vulnrichment"}],"cna":{"affected":[{"defaultStatus":"unaffected","modules":["key exchange"],"product":"wolfSSH","programFiles":["src/internal.c"],"programRoutines":[{"name":"IsMessageAllowedServer"},{"name":"DoKexDhGexGroup"},{"name":"ValidateKexDhGexGroup"}],"repo":"https://github.com/wolfSSL/wolfssh","vendor":"wolfSSL Inc.","versions":[{"changes":[{"at":"1.6.0","status":"unaffected"}],"lessThanOrEqual":"1.5.0","status":"affected","version":"1.2.0","versionType":"semver"}]}],"credits":[{"lang":"en","type":"finder","value":"Abdullah Al Ishtiaq, Kai Tu, Matthew Carter, Xiaotian Zhou, Ananna Rahman, Yilu Dong, Tianwei Yu, Ali Ranjbar, Syed Rafiul Hussain"}],"descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<code>src/internal.c</code> in wolfSSL wolfSSH through 1.5.0 admits the server-to-client Diffie-Hellman group exchange messages <code>SSH_MSG_KEX_DH_GEX_GROUP</code> (31) and <code>SSH_MSG_KEX_DH_GEX_REPLY</code> (33) when a server receives them from an unauthenticated client. <code>IsMessageAllowedServer()</code> 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 <code>handshake-&gt;expectMsgId</code> 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 <code>diffie-hellman-group-exchange-sha256</code> and then sends message 31 makes the server run the client-side handler <code>DoKexDhGexGroup()</code>, which validates the attacker-supplied group with two 8-round Miller-Rabin primality tests, one on <code>p</code> and one on <code>(p-1)/2</code>, 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 <code>SSH_MSG_KEX_DH_GEX_INIT</code> (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 <code>WOLFSSH_NO_DH_GEX_SHA256</code>, which is implied by <code>WOLFSSH_NO_DH</code> or <code>NO_SHA256</code>, are unaffected.<br>"}],"value":"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."}],"impacts":[{"descriptions":[{"lang":"en","value":"Pre-authentication CPU exhaustion with a high work-per-byte ratio, plus key exchange role confusion. One unauthenticated packet of roughly 1 KB costs a wolfSSH server about 0.48 seconds of single-core CPU when it carries the 4096-bit RFC 3526 safe prime, and about 5.8 seconds when it carries the 8192-bit one, measured on a 64-bit desktop core; a single-threaded or embedded server is unavailable for that whole interval, and the cost repeats on every connection. The server then stores the attacker-chosen group, generates a Diffie-Hellman key pair in it, and sends the client-role message SSH_MSG_KEX_DH_GEX_INIT back to the attacker, so the key exchange continues in the wrong role until it fails. Reaching the 8192-bit case requires a wolfSSL math configuration that can represent an 8192-bit integer; a default build tops out near 4096 bits and caps the burn at roughly half a second."}]},{"capecId":"CAPEC-227","descriptions":[{"lang":"en","value":"CAPEC-227 Sustained Client Engagement"}]}],"metrics":[{"cvssV4_0":{"Automatable":"YES","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"LOW","attackRequirements":"NONE","attackVector":"NETWORK","baseScore":6.9,"baseSeverity":"MEDIUM","exploitMaturity":"NOT_DEFINED","privilegesRequired":"NONE","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","userInteraction":"NONE","valueDensity":"NOT_DEFINED","vectorString":"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/AU:Y","version":"4.0","vulnAvailabilityImpact":"LOW","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnerabilityResponseEffort":"NOT_DEFINED"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-372","description":"CWE-372 Incomplete Internal State Distinction","lang":"en","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-405","description":"CWE-405 Asymmetric Resource Consumption (Amplification)","lang":"en","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-400","description":"CWE-400 Uncontrolled Resource Consumption","lang":"en","type":"CWE"}]}],"providerMetadata":{"dateUpdated":"2026-10-07T02:42:28.388Z","orgId":"50d2cd11-d01a-48ed-9441-5bfce9d63b27","shortName":"wolfSSL"},"references":[{"name":"Fix PR #1221","tags":["patch"],"url":"https://github.com/wolfSSL/wolfssh/pull/1221"},{"name":"Fix commit a472f1ee (reject the KEX replies a server never receives)","tags":["patch"],"url":"https://github.com/wolfSSL/wolfssh/commit/a472f1ee2b653f623d85ef2297321733f1dbfd22"},{"name":"RFC 4419 sections 3 and 5 (SSH_MSG_KEX_DH_GEX_GROUP and SSH_MSG_KEX_DH_GEX_REPLY are sent by the server)","tags":["technical-description"],"url":"https://www.rfc-editor.org/rfc/rfc4419.html"},{"name":"RFC 3526 (published MODP safe primes usable as the worst-case input)","tags":["technical-description"],"url":"https://www.rfc-editor.org/rfc/rfc3526.html"}],"source":{"discovery":"EXTERNAL"},"title":"wolfSSH server accepts server-to-client DH group exchange messages from an unauthenticated client, causing pre-authentication primality-test CPU exhaustion and key exchange role confusion","workarounds":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"Build wolfSSH with <code>WOLFSSH_NO_DH_GEX_SHA256</code> defined so that <code>diffie-hellman-group-exchange-sha256</code> is neither offered nor accepted, which removes the message 31 dispatch path entirely. Where group exchange must stay available, lowering <code>WOLFSSH_DEFAULT_GEXDH_MAX</code> reduces the size of the value a peer can submit for primality testing and so the cost of a single packet, but it does not stop a server from accepting the message.<br>"}],"value":"Build wolfSSH with WOLFSSH_NO_DH_GEX_SHA256 defined so that diffie-hellman-group-exchange-sha256 is neither offered nor accepted, which removes the message 31 dispatch path entirely. Where group exchange must stay available, lowering WOLFSSH_DEFAULT_GEXDH_MAX reduces the size of the value a peer can submit for primality testing and so the cost of a single packet, but it does not stop a server from accepting the message."}],"x_generator":{"engine":"Vulnogram 1.0.5"}}},"cveMetadata":{"assignerOrgId":"50d2cd11-d01a-48ed-9441-5bfce9d63b27","assignerShortName":"wolfSSL","cveId":"CVE-2026-84897","datePublished":"2026-10-07T02:42:28.388Z","dateReserved":"2026-09-02T15:07:44.223Z","dateUpdated":"2026-10-07T18:37:00.316Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-10-07 03:17:00","lastModifiedDate":"2026-10-13 14:27:11","problem_types":["CWE-372","CWE-400","CWE-405","CWE-372 CWE-372 Incomplete Internal State Distinction","CWE-405 CWE-405 Asymmetric Resource Consumption (Amplification)","CWE-400 CWE-400 Uncontrolled Resource Consumption"],"metrics":{"cvssMetricV40":[{"source":"facts@wolfssl.com","type":"Secondary","cvssData":{"version":"4.0","vectorString":"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","baseScore":6.9,"baseSeverity":"MEDIUM","attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnAvailabilityImpact":"LOW","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","confidentialityRequirement":"NOT_DEFINED","integrityRequirement":"NOT_DEFINED","availabilityRequirement":"NOT_DEFINED","modifiedAttackVector":"NOT_DEFINED","modifiedAttackComplexity":"NOT_DEFINED","modifiedAttackRequirements":"NOT_DEFINED","modifiedPrivilegesRequired":"NOT_DEFINED","modifiedUserInteraction":"NOT_DEFINED","modifiedVulnConfidentialityImpact":"NOT_DEFINED","modifiedVulnIntegrityImpact":"NOT_DEFINED","modifiedVulnAvailabilityImpact":"NOT_DEFINED","modifiedSubConfidentialityImpact":"NOT_DEFINED","modifiedSubIntegrityImpact":"NOT_DEFINED","modifiedSubAvailabilityImpact":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"YES","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED"}}],"cvssMetricV31":[{"source":"nvd@nist.gov","type":"Primary","cvssData":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","baseScore":5.3,"baseSeverity":"MEDIUM","attackVector":"NETWORK","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"NONE","integrityImpact":"NONE","availabilityImpact":"LOW"},"exploitabilityScore":3.9,"impactScore":1.4}],"ssvcV203":[{"source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","ssvcData":{"timestamp":"2026-10-07T18:36:45.750446Z","id":"CVE-2026-84897","options":[{"exploitation":"none"},{"automatable":"yes"},{"technicalImpact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}]},"configurations":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:a:wolfssh:wolfssh:*:*:*:*:*:*:*:*","versionStartIncluding":"1.2.0","versionEndExcluding":"1.6.0","matchCriteriaId":"A689263E-D6EE-4C4B-A6A4-6FB453EE5581"}]}]}]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"84897","Ordinal":"1","Title":"wolfSSH server accepts server-to-client DH group exchange messag","CVE":"CVE-2026-84897","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"84897","Ordinal":"1","NoteData":"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.","Type":"Description","Title":"wolfSSH server accepts server-to-client DH group exchange messag"}]}}}