201 Commits

Author SHA1 Message Date
metalefty bb0c5984c2 Merge commit from fork
CVE-2026-54538: Pre-auth infinite loop in TS_SHARECONTROLHEADER
2026-07-02 17:30:17 +09:00
matt335672 b1edb60c1d CVE-2026-55645: OOB read in Client Control PDU processing 2026-06-17 09:14:18 +01:00
matt335672 2394084bf4 CVE-2026-54538: Pre-auth infinite loop in TS_SHARECONTROLHEADER 2026-06-16 09:50:01 +01:00
firewave 214cf50df5 fixed some unreadVariable Cppcheck warnings 2026-03-03 16:33:51 +01:00
firewave 67c11f0443 mitigated -Wdocumentation and -Wdocumentation-unknown-command Clang compiler warnings 2025-11-04 13:40:33 +01:00
matt335672 7f6899567b Allow TLS pre-master secrets to be recorded
This allows for RDP sessions to be easily decrypted within Wireshark
2025-09-12 11:55:19 +01:00
matt335672 0a13316e6a ms-rdpbcgr.h: Rename incorrect slow path constants
Rename the defines from [MS-RDPBCGR] 2.2.9.1.1.3.1 to match
the documentation.
2025-09-09 15:15:46 +01:00
matt335672 2759680b8b ms-rdpbcgr.h: Rename incorrect PDUTYPE2_ defines
Rename the defines from [MS-RDPBCGR] 2.2.8.1.1.1.2 to
match the documentation.
2025-09-09 15:14:28 +01:00
matt335672 aade869fb7 Merge pull request #3607 from matt335672/fix_incorrect_control_pdu_vals
Fix more inconsistencies with [MS-RDPBCGR]
2025-09-06 10:04:35 +01:00
matt335672 fa6ed3c702 Fix more inconsistencies with [MS-RDPBCGR] 2025-09-05 12:19:56 +01:00
matt335672 4c8f2abf6d Fill in all fields for TS_DEACTIVATE_ALL_PDU 2025-09-05 11:42:44 +01:00
matt335672 d015535065 Add CCP support to xrdp
This allows sesexec to send a reason for a connection close
request to xrdp.

xrdp is also updated to support server initiated disconnection sequences
from [MS-RDPBCGR] 1.3.1.4, along with reporting a reason to the client
for the disconnection.
2025-07-21 11:30:14 +01:00
matt335672 b2892fbe5e Factor out xup_client_info for xorgxrdp
The data in 'struct xrdp_client_info' which is shared with xorgxrdp
is separated out into a separate structure. This makes it simpler to
change 'struct xrdp_client_info' without affecting xorgxrdp.
2025-05-28 11:53:21 +01:00
gpotter2 f0bae0050c vmconnect mode: support all security modes when used in Hyper-V environment 2025-05-06 21:49:56 +02:00
matt335672 463e500f77 Security improvements
1) In FIPS mode, Classic RDP security is not allowed at all.
2) In FIPS mode xrdp-keygen creates an empty file
3) Documentation wording improved around the security_level setting
4) Logging improved around the security negotiation
5) Warnings now generated if Classic RDP security is negotiated
2025-05-06 11:30:36 +01:00
matt335672 697dcbb24d Start the drdynvc channel within xrdp_wm
The responsibility for starting the drdynvc channel is moved out of
libxrdp into the application. This will make it easier to allow the
application to check the channel is enabled before starting it.
2024-03-11 11:00:53 +00:00
matt335672 74598d1cc3 Fix sending of monitor layout PDU
From [MS-RCPBCGR] 3.3.5.12.1:-

> ...The contents of this PDU SHOULD NOT be compressed.
>
> This PDU MUST NOT be sent to a client that has not indicated support for
> it by setting the RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU flag (0x0040)
> in the earlyCapabilityFlags field of the Client Core Data (section
> 2.2.1.3.2).

Also, 2.2.12.1 specifies the source channel must be zero.

In testing, a compressed monitor layout PDU causes mstsc.exe
to exit with a protocol error.
2024-02-15 16:47:15 +00:00
matt335672 54acca43cf Resize state machine: A fix and a question (#2929)
* Store EGFX state before entering resize state machine

At present the EGFX state is destroyed by states WMRZ_EGFX_DELETE_SURFACE
through WRMZ_EGFX_DELETE. This means that at WMRZ_EGFX_INITIALIZE we
cannot distinguish between EGFX not being ever used, and EGFX
having been torn down. Consequently, when running non-GFX, we don't
correctly recover the session.

* Allow multiple reasons for suppress_output

Replaces the single boolean for suppress_output with
a bitmask, to allow output to be suppressed for
more than one reason

* Disable output during resize

* Add states to dynamic resize

Adds states to the dynamic resize state machine so we wait for a
Deactivation-Reactivation sequence to finish before sending pointer
updates, etc.

* suppress module output during the dynamic resize

* Add support for dynamic resize to VNC backend

xrdp_mm needs to be informed when a resize has been performed so that
the resize stte machine can be updsate.
2024-01-31 19:08:29 -05:00
matt335672 79bec8110c Unify connection fields for the connected client
The connected client is currently described in two places in
the xrdp_client_info structure:-

1) In the connection_description field. This was introduced as
   field client_ip by commit d797b2cf49
   for xrdp v0.6.0

2) In the client_addr and client_port fields introduced by commit
   25369460a1 for xrdp v0.8.0

This commit unifies these two sets of fields into a single
set of fields describing the connection IP and port (for
AF_INET/AF_INET6 connections only) and a connection description
for all connection types.

The code in os_calls to provide client logging has been simplified
somewhat which should make it easier to add new connection types (e.g.
AF_VSOCK).

The old connection_description field used to be passed to sesman to
inform sesman of the IP address of the client, and also to provide
a string for 'C' field session policy matching. 'C' field session policy
matching does not actually need this string (see #2239), and so now only
the IP field is passed to sesman.
2022-05-18 12:35:07 +01:00
matt335672 c894ba5b40 Better logging of classic connection security 2022-01-28 12:23:40 +00:00
matt335672 c39bb18469 Fix buffer size check 2021-12-02 13:47:09 +00:00
matt335672 60016c1f75 Rename client_ip to connection_description 2021-10-25 11:35:35 +01:00
TOMATO-ONE 7847b23808 Bug fix when parameter is 0 2021-08-16 00:20:13 +09:00
TOMATO-ONE badc612a8a override keyboard infomation #1950 2021-08-08 22:23:01 +09:00
matt335672 763f8fab7f xrdp_rdp_send_data() now works with --enable-devel-streamcheck 2021-05-28 10:57:12 +01:00
Koichiro IWAO b7f5004008 Demote some too verbose logs to TRACE level
Fixes #1864.
2021-04-26 11:49:46 +09:00
matt335672 89843b12f4 Add versioning to xrdp_client_info 2021-02-26 11:27:13 +00:00
aquesnel 0ec471b02d Add detailed logging to libxrdp (#1742)
* Added s_rem(s) for getting the remaining bytes in a stream
* Added s_rem_out() macro
* Fixed 15bpp pointer error checking
* Combined the 512 and 2048 bit certificate sending  code paths
* Other detailed comments and logging added following MS-RDPBCGR
2021-02-04 10:11:54 +00:00
metalefty bba65b3592 Merge pull request #1738 from aquesnel/unify_logging_libxrdp
Unify logging in libxrdp
2020-12-23 09:59:21 +09:00
matt335672 5523847540 Allow FuseMountName for chansrv to be absolute path 2020-12-21 12:36:31 +00:00
Alexandre Quesnel 121c17e818 Removing duplicate logging statements 2020-12-12 17:05:09 +00:00
Alexandre Quesnel a82ee03d4d Changing LOG_DEVEL to LOG to avoid silent failures. 2020-12-05 19:22:50 +00:00
Alexandre Quesnel 2d6d249f76 Fixing code formatting with astyle 2020-11-30 05:04:11 +00:00
Alexandre Quesnel 51905d765a Migrating logging to LOG() and LOG_DEVEL() in libxrdp/* 2020-11-30 05:04:10 +00:00
matt335672 ebc21fe180 Added -c / --config to xrdp 2020-10-16 10:55:23 +01:00
Bolke de Bruin a6a0e5e004 Allow domain name to be concatenated to username
If a server is multihomed (i.e. mutiple domains) the
users are identified by their domain name. This change
allows to concat the domain name to the username with
a specific separator.
2020-08-30 21:56:16 +02:00
Bolke de Bruin b0bca1363e Add support for token authentication
This feature allows to embed a token in the username field. Tokens
are separated from the username by the ASCII field separator character
0x1F (unicode 0x001F).
2020-08-29 10:40:22 +02:00
matt335672 6f881d47d3 Rationalise ms- constants
Constants from MS documents (MS-RDPBCGR etc) moved out of
common/xrdp_constants.h into includes named after the documents.

Similar includes moved from sesman/chansrv to the common area.
2020-01-06 15:46:37 +00:00
Jay Sorg 0fbbc47092 cleanup refresh rect and check stream bounds 2019-11-07 02:03:57 +00:00
Jay Sorg 21f90e3ca2 work on suppress 2019-04-25 14:54:25 -07:00
Jay Sorg 9e9cada4ec work on suppress 2019-04-25 14:54:25 -07:00
Jay Sorg ecf4acf5f1 work on suppress 2019-04-25 14:54:25 -07:00
Koichiro IWAO 0e9e25f100 use MS name for PDU types
RDP_PDU_REDIRECT has been removed as it is not found in MS-RDPBCGR and
not used anywhere.
2018-12-12 17:40:58 +09:00
daixj bc150c2e56 set use_cache_glyph_v2 on if the client support 2018-10-25 17:02:43 +08:00
daixj b3a1889200 Support Cache Glyph Revison 2, issue #367 2018-10-25 10:34:00 +08:00
jsorg71 ae1514c167 dynamic virtual channel improvements
remove not used chansrv <-> xrdp messages
move static channel disable control into libxrdp
remove some blocking read, write chansrv calls
add drdynvc calls to libxrdp
add drdynvc calls to chansrv
channel cleanup
2018-10-11 22:09:20 -07:00
Jay Sorg 8d63c32899 move openssl calls to common/libssl.c, check for defines 2017-06-22 11:47:48 +09:00
Koichiro IWAO a1b0344db5 Use the words "cannot read" rather than "cannot open"
as the code actually tests readability.
2017-06-12 16:57:04 +09:00
Koichiro IWAO 65c1fe87d7 Log user-friendly message when certificate/privkey is inaccessible
We shouldn't assume that xrdp daemon is running under root privilege.
In many cases, root privilege is not really needed for xrdp daemon.
xrdp may fail to load certificate/privkey due to lack of permissions
when running under user privilege. Checking existence of files is not
enough and xrdp should output user-friendly log in such case.

Reported by Debian user in bug 856436 [1].

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856436
2017-06-12 16:57:04 +09:00
Pavel Roskin 43899b7e0c Allocate space for tls_ciphers dynamically 2017-03-21 10:39:40 -07:00