Skip to content

Send RDP gateway writes as single TLS records - #487

Merged
oschwartz10612 merged 1 commit into
fosrl:devfrom
blakey108:fix-rdsaad-tls-record
Nov 20, 2026
Merged

oschwartz10612 merged 1 commit into
fosrl:devfrom
blakey108:fix-rdsaad-tls-record

Conversation

@blakey108

Copy link
Copy Markdown

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

AI Disclosure

An AI coding assistant helped me find the cause in a packet capture, write the change and draft this description. I reviewed the change and tested it myself against a Windows 11 host.

Description

The browser gateway's TLS connection to the RDP host uses Go's default dynamic record sizing, which caps the first records of a connection at about 1 KB. That splits a large first write across several TLS records.

RDS AAD Auth (Microsoft Entra ID sign-in, PROTOCOL_RDSAAD) sends its Authentication Request, about 6.6 KB, as the first client write after the handshake. Windows rejects the request when it arrives in more than one record: RdpCoreTS logs "Authentication Request is invalid" (0x80090308, SEC_E_INVALID_TOKEN) within a millisecond. Microsoft's own clients send it in one record.

This sets DynamicRecordSizingDisabled: true on that TLS config, so each write goes out as a single record. It only affects record framing on the gateway-to-host connection.

Related: fosrl discussion #3388.

How to test?

  1. Capture the gateway-to-host traffic of an RDS AAD sign-in. Before the change the Authentication Request is three TLS application-data records (about 1.2, 2.4 and 3.1 KB); after it, one record.
  2. With a client that speaks RDS AAD Auth, sign in to an Entra joined Windows 11 host with NLA required. Before the change the host answers with a failure result and logs the event above; after it, validation proceeds.
  3. Password sign-in over CredSSP and VNC/SSH sessions are unaffected.

With dynamic record sizing, crypto/tls caps the first records of a
connection at about 1 KB, which splits the RDS AAD Authentication
Request across several records. Windows rejects the split request as
invalid (SEC_E_INVALID_TOKEN, 0x80090308).
@oschwartz10612

Copy link
Copy Markdown
Member

Sure LGTM thanks

@oschwartz10612
oschwartz10612 merged commit 9dc54a8 into fosrl:dev Nov 20, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants