Weak Diffie-Hellman Key Exchange Parameters
The service uses Diffie-Hellman key exchange with a group of 1024 bits or fewer, which a well-resourced attacker could break to decrypt the sessions that rely on it.
| Severity | Low |
| CVSS 3.1 | 3.7 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N Open in the calculator |
| CVSS 4.0 | 6.3 CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-326: Inadequate Encryption Strength |
| OWASP Top 10 | A04:2025 Cryptographic Failures |
| MITRE ATT&CK | T1040 Network Sniffing, T1557 Adversary-in-the-Middle |
| Category | Cryptographic Failures |
Description
The service supports ephemeral Diffie-Hellman (DHE) key exchange using a finite field group of 1024 bits or fewer. The secrecy of each session key rests on the difficulty of computing discrete logarithms in that group, and groups of this size no longer give an adequate margin. An attacker with very large computing resources who has recorded traffic could decrypt sessions that used a weak group, exposing whatever they carried, such as credentials and session tokens.
The Logjam research in 2015 showed two practical problems. Export-grade groups of 512 bits, offered by servers that still enable DHE_EXPORT suites, can be broken quickly enough to downgrade and intercept a live connection (CVE-2015-4000), so where export-grade or 512-bit groups are accepted, the attack is within the means of a modest attacker who can intercept traffic, and the rating should be raised.
More widely, many servers use the same few standard or default 1024-bit primes, and a single large precomputation for one of those primes would let an attacker decrypt passively recorded sessions that used it, an effort considered within the reach of nation-state adversaries. For 1024-bit groups this is beyond the reach of most attackers, so the practical risk is limited to well-resourced adversaries and to the future decryption of traffic recorded today.
Weak groups usually come from older software defaults or a parameter file generated years ago. The group size is shown by testssl.sh, sslscan and SSLyze, and by Nmap's ssl-dh-params script, which also identifies commonly shared primes. The issue concerns only DHE suites in TLS 1.2 and earlier: TLS 1.3 negotiates only standard named groups of 2048 bits or more, and elliptic curve key exchange (ECDHE) is not affected.
Remediation
Prefer elliptic curve key exchange, and where finite field Diffie-Hellman must stay, use a group of at least 2048 bits:
- Order the cipher list so that ECDHE suites come first. Where no client needs DHE, remove the DHE suites altogether, as the OWASP TLS guidance recommends for TLS 1.2.
- Where DHE is kept, use a group of 2048 bits or more, preferably one of the standard groups defined in RFC 7919 (
ffdhe2048orffdhe3072), and never a 1024-bit or smaller group or aDHE_EXPORTsuite.
- On Windows (Schannel), set the DWORD value
ServerMinKeyBitLengthunderHKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\KeyExchangeAlgorithms\Diffie-Hellmanto0x800(2048 bits), then restart the server. - For Java, raise the size with the
jdk.tls.ephemeralDHKeySizesystem property, or remove the DHE suites.
Confirm the fix by rescanning the service and checking that every DHE suite uses a group of at least 2048 bits, or that none is offered.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.