1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00
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-10-04 20:33:12 +02:00
2026-09-13 16:12:32 +02:00
2026-09-13 16:12:32 +02:00
2026-04-10 18:39:11 +02:00
2026-09-14 11:22:52 +02:00
2023-06-07 08:18:55 +02:00
2011-04-04 13:31:33 +02:00
2026-10-02 23:56:07 +02:00

libssh2 - SSH2 library

libssh2 is a library implementing the SSH2 protocol, available under the revised BSD license.

Web site

Mailing list

BSD Licensed

Web site source code

Installation instructions:

Description
libssh2 - это библиотека, реализующая протокол SSH2, доступная по пересмотренной лицензии BSD
Readme 26 MiB
Languages
C 84.2%
CMake 3.7%
Perl 3.2%
M4 2.7%
Shell 2.3%
Other 3.7%