From 5d72302e1b777ae879f202678f5c1fd4c9b15fbf Mon Sep 17 00:00:00 2001
From: matt335672 <30179339+matt335672@users.noreply.github.com>
Date: Mon, 15 Jun 2026 10:36:24 +0100
Subject: [PATCH] CVE-2026-55639: OOB read in GCC Conference Create Request

(cherry picked from commit 9d16ec4e756b332e0e4cedea342890bca70a7042)
---
 libxrdp/xrdp_sec.c | 4 ++++
 1 file changed, 4 insertions(+)

--- a/libxrdp/xrdp_sec.c
+++ b/libxrdp/xrdp_sec.c
@@ -2286,6 +2286,10 @@ xrdp_sec_process_mcs_data_CS_SECURITY(st
     int crypt_method;
     int found;
 
+    if (!s_check_rem_and_log(s, 4, "Parsing [MS-RDPBCGR] CS_SECURITY"))
+    {
+        return 1;
+    }
     in_uint32_le(s, crypt_method);
     LOG_DEVEL(LOG_LEVEL_TRACE, "Received [MS-RDPBCGR] TS_UD_CS_SEC "
               "encryptionMethods 0x%8.8x, extEncryptionMethods (ignored)",
