xrdp/xrdp-CVE-2022-23483.patch
Yifan Jiang f0ddc89311 Accepting request 1057176 from home:yudaike:branches:X11:RemoteDesktop
- xrdp-CVE-2022-23477.patch (bsc#1206301)
  + Buffer over flow in audin_send_open() function

- Security fixes:
  + xrdp-CVE-2022-23468.patch (bsc#1206300)
    * Buffer overflow in xrdp_login_wnd_create()
  + xrdp-CVE-2022-23478.patch (bsc#1206302)
    * Out of Bound Write in xrdp_mm_trans_process_drdynvc_chan
  + xrdp-CVE-2022-23479.patch (bsc#1206303)
    * Buffer overflow in xrdp_mm_chan_data_in() function
  + xrdp-CVE-2022-23480.patch (bsc#1206306)
    * Buffer overflow in devredir_proc_client_devlist_announce_req
  + xrdp-CVE-2022-23481.patch (bsc#1206307)
    * Out of Bound Read in xrdp_caps_process_confirm_active()
  + xrdp-CVE-2022-23482.patch (bsc#1206310)
    + Out of Bound Read in xrdp_sec_process_mcs_data_CS_CORE()
  + xrdp-CVE-2022-23483.patch (bsc#1206311)
    + Out of Bound REad in libxrdp_send_to_channel()
  + xrdp-CVE-2022-23484.patch (bsc#1206312)
    + Integer Overflow in xrdp_mm_process_rail_update_window_text()
  + xrdp-CVE-2022-23493.patch (bsc#1206313)
    + Out of Bound Read in xrdp_mm_trans_process_drdynvc_channel_close()

OBS-URL: https://build.opensuse.org/request/show/1057176
OBS-URL: https://build.opensuse.org/package/show/X11:RemoteDesktop/xrdp?expand=0&rev=106
2023-01-10 03:10:49 +00:00

64 lines
1.7 KiB
Diff

From 5c95289b98f10f5a0be098e4bc9c0d189db171ca Mon Sep 17 00:00:00 2001
From: matt335672 <30179339+matt335672@users.noreply.github.com>
Date: Wed, 7 Dec 2022 10:21:41 +0000
Subject: [PATCH 7/9] CVE-2022-23483
Sanitise channel data being passed from application
Avoids OOB read if the size field is incorrect.
---
xrdp/xrdp_mm.c | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c
index c91e03ab..bc7b1b83 100644
--- a/xrdp/xrdp_mm.c
+++ b/xrdp/xrdp_mm.c
@@ -676,22 +676,31 @@ xrdp_mm_trans_send_channel_setup(struct xrdp_mm *self, struct trans *trans)
static int
xrdp_mm_trans_process_channel_data(struct xrdp_mm *self, struct stream *s)
{
- int size;
- int total_size;
+ unsigned int size;
+ unsigned int total_size;
int chan_id;
int chan_flags;
- int rv;
-
- in_uint16_le(s, chan_id);
- in_uint16_le(s, chan_flags);
- in_uint16_le(s, size);
- in_uint32_le(s, total_size);
- rv = 0;
+ int rv = 0;
- if (rv == 0)
+ if (!s_check_rem_and_log(s, 10, "Reading channel data header"))
+ {
+ rv = 1;
+ }
+ else
{
- rv = libxrdp_send_to_channel(self->wm->session, chan_id, s->p, size, total_size,
- chan_flags);
+ in_uint16_le(s, chan_id);
+ in_uint16_le(s, chan_flags);
+ in_uint16_le(s, size);
+ in_uint32_le(s, total_size);
+ if (!s_check_rem_and_log(s, size, "Reading channel data data"))
+ {
+ rv = 1;
+ }
+ else
+ {
+ rv = libxrdp_send_to_channel(self->wm->session, chan_id,
+ s->p, size, total_size, chan_flags);
+ }
}
return rv;
--
2.39.0