1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00
Files
libssh2/src
syed abdul khaliq 7f28c290d3 wincng: validate Diffie-Hellman public value in ssh2_dh_secret()
ssh2_dh_secret() in the Windows CNG backend uses the server's
Diffie-Hellman public value f without the range check the other four
backends apply through ssh2_dh_validate(), so a malicious server can
send f of 0, 1 or p-1 and push the shared secret into a trivial subgroup
that openssl, libgcrypt, mbedtls and os400qc3 all reject with
LIBSSH2_ERROR_PROTO. This adds a WinCNG ssh2_dh_validate() that enforces
1 < f < p-1 and the same minimum-set-bits check on the big-endian value,
and calls it at the top of ssh2_dh_secret() like the other backends do.
The shared test_ssh2_dh_validate() in tests/test_simple.c was stubbed
out on WinCNG only because the function did not exist, so it now runs
against the real implementation too.

Reported-by: yaotushaozhu on github
Ref: GHSA-m9rg-h9jv-9gvh
Follow-up to fcf830788d #2239

Closes #2645
2026-10-04 21:17:02 +02:00
..
2026-06-30 00:12:47 +02:00
2026-06-21 23:15:10 +02:00
2026-09-13 16:12:32 +02:00
2026-08-14 02:07:18 +02:00
2026-06-05 18:12:37 +02:00
2026-08-14 01:58:59 +02:00
2026-10-04 20:33:12 +02:00
2026-09-13 16:12:32 +02:00
2026-08-28 13:46:01 +02:00
2023-08-18 11:20:58 +00:00
2026-07-29 02:53:01 +02:00
2026-10-04 20:33:12 +02:00
2026-05-13 12:00:36 +02:00
2026-07-28 03:20:30 +02:00
2026-07-22 01:40:19 +02:00