From: Yeonggi Kim <[email protected]>

For supported_groups, ec_point_formats, signature_algorithms and
supported_versions, ssl_sock_parse_clienthello() replaces rec_len with
the inner list length before "msg += rec_len". If the extension body is
longer than the list, the remaining bytes are parsed as another
extension: 4 extra bytes "dead0000" in supported_groups make
ssl_fc_extlist_bin report 000ADEAD000D instead of 000A000D.

Reads stay within extensions_end, and such a malformed ClientHello fails
the handshake, so only the values logged for it are affected. Jump to
list_end instead.

This was introduced in 2.5 by commit 769fd2e44 ("MEDIUM: ssl: Capture
more info from Client Hello") and should be backported to all stable
branches.
---
v2: this fix is new and goes first; 2/2 is v1 unchanged except the message.

 src/ssl_sock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 90da22762..844484391 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -2309,7 +2309,7 @@ static void ssl_sock_parse_clienthello(int write_p, int 
version,
                default:
                        break;
                }
-               msg += rec_len;
+               msg = list_end;
        }
 
        if (ec_start) {
-- 
2.52.0



Reply via email to