36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
From 3d45a63b16f64ac53abe9f1a02135e8daf1020f8 Mon Sep 17 00:00:00 2001
|
|
From: Alexander Sosedkin <asosedkin@redhat.com>
|
|
Date: Tue, 7 Apr 2026 10:16:03 +0200
|
|
Subject: [PATCH] session_pack: validate session_id_size on unpacking
|
|
|
|
A check for session_id_size not exceeding GNUTLS_MAX_SESSION_ID_SIZE
|
|
on loading persisted TLS session data was overlooked,
|
|
leading to a heap overflow
|
|
were the data corrupted in a malicious manner.
|
|
|
|
Reported-by: Haruto Kimura (Stella)
|
|
Fixes: #1817
|
|
Signed-off-by: Alexander Sosedkin <asosedkin@redhat.com>
|
|
---
|
|
lib/session_pack.c | 4 ++++
|
|
1 file changed, 4 insertions(+)
|
|
|
|
diff --git a/lib/session_pack.c b/lib/session_pack.c
|
|
index bd1ce3361..6c1d98270 100644
|
|
--- a/lib/session_pack.c
|
|
+++ b/lib/session_pack.c
|
|
@@ -973,6 +973,10 @@ static int unpack_security_parameters(gnutls_session_t session,
|
|
&session->internals.resumed_security_parameters.session_id_size,
|
|
1);
|
|
|
|
+ if (session->internals.resumed_security_parameters.session_id_size >
|
|
+ GNUTLS_MAX_SESSION_ID_SIZE)
|
|
+ return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
|
|
+
|
|
BUFFER_POP(
|
|
ps, session->internals.resumed_security_parameters.session_id,
|
|
session->internals.resumed_security_parameters.session_id_size);
|
|
--
|
|
2.53.0
|
|
|