FreeRDP RD Gateway chunked HTTP response bypasses size limit
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
The chunked transfer path in libfreerdp/core/gateway/http.c, function http_response_recv_body(), accumulates the body without applying RESPONSE_SIZE_LIMIT (64 MiB), while the non-chunked path enforces it. A malicious or compromised RD Gateway, WST or gateway HTTP endpoint can make a FreeRDP client store a chunked response body larger than the intended limit. The issue is reported as client-side availability and resource exhaustion. FreeRDP 3.28.0 and earlier are affected.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
## Summary `libfreerdp/core/gateway/http.c` defines `RESPONSE_SIZE_LIMIT` as `64 MiB`. The non-chunked HTTP response path enforces this limit, but the `Transfer-Encoding: chunked` path in `http_response_recv_body()` accumulates the chunked body without applying the same cap. The result is that a malicious or compromised RD Gateway / WST / gateway HTTP endpoint can make a FreeRDP client store a chunked response body larger than the intended response limit. I am reporting this conservatively as client-side availability/resource exhaustion only. ## Affected code Affected function: ```text libfreerdp/core/gateway/http.c:http_response_recv_body() ``` Relevant code shape in `3.28.0`: ```c if (isChunked) { int full_len = 0; while (true) { if (!Stream_EnsureRemainingCapacity(response->data, 2048)) goto out_error; int status = http_chuncked_read(tls->bio, Stream_Pointer(response->data), Stream_GetRemainingCapacity(response->data), &response->encodingContext.context.chunked); if (status < 0) goto out_error; if (status == 0) break; Stream_Seek(response->data, (size_t)status); full_len += status; } response->BodyLength = WINPR_ASSERTING_INT_CAST(uint32_t, full_len); } ``` By contrast, the non-chunked body path later in the same function increments `response->BodyLength` while reading and rejects oversized responses: ```c response->BodyLength += (unsigned long)status; if (response->BodyLength > RESPONSE_SIZE_LIMIT) goto out_error; ``` So the root cause is not simply "large HTTP body accepted"; it is a consistency gap where one transfer mode enforces the configured response size limit and the chunked mode does not. ## Reproduction I reproduced this locally in Docker against the unmodified FreeRDP `3.28.0` parser logic. Harness: ```text E:\vul-tower\audit_freerdp_20260706\docker_repro\freerdp_gateway_http_chunked_limit_harness.c ``` Fresh release run log: ```text E:\vul-tower\audit_freerdp_20260706\docker_repro\gateway_http_chunked_limit_release_run_fresh_20260707.txt ``` The harness includes the upstream `http.c` directly and feeds valid HTTP responses through `http_response_recv(&tls, TRUE)` using a memory BIO. It compares three cases: 1. A small chunked body. 2. A chunked body of `64 MiB + 4096`. 3. A non-chunked `Content-Length` body over the same limit as a control case. Observed output: ```text chunked_small: status=200 body_len=4096 transfer=2 chunked_over_64mb: status=200 body_len=67112960 transfer=2 content_length_over_64mb: status=200 body_len=0 transfer=1 ``` `67112960` is `64 MiB + 4096`. The non-chunked over-limit control case is rejected/left with `body_len=0`, while the over-limit chunked body is accepted and exposed through the parsed response object. ## Observed behavior The client accepts and stores the oversized chunked response body. The existing `RESPONSE_SIZE_LIMIT` is not applied to this path. ## Expected behavior Chunked response bodies should be subject to the same response size limit as non-chunked bodies. Once the accumulated chunked body would exceed `RESPONSE_SIZE_LIMIT`, the response should be rejected and parsing should fail cleanly. ## Impact and threat model - Attacker position: malicious or compromised RD Gateway / WST / gateway HTTP endpoint. - Affected side: FreeRDP client. - Confirmed impact: client memory/resource consumption from an oversized gateway HTTP response. - Not claimed: RCE, memory corruption, information disclosure. ## Suggested fix direction Apply `RESPONSE_SIZE_LIMIT` while accumulating chunked bodies. For example, reject before adding a chunk if it would make the accumulated body exceed the cap. It would also be safer to use a `size_t` accumulator instead of `int full_len`. One possible shape: ```c if ((size_t)status > RESPONSE_SIZE_LIMIT - full_len) goto out_error; full_len += (size_t)status; ``` The exact error handling can follow the existing non-chunked over-limit path.
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 (c/c++ application) | <= 3.28.0 | 3.29.0 | Patch available | GHSA-2c6r-4pr4-9x8m |
- FreeRDP (c/c++ application) Vendor— Affected <= 3.28.0 Fixed in 3.29.0 Patch available GHSA-2c6r-4pr4-9x8m
Remediation
Upgrade FreeRDP to version 3.29.0, which fixes this issue.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-2c6r-4pr4-9x8m FreeRDP (c/c++ application) Fixed in 3.29.0 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-2c6r-4pr4-9x8m
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences