Read the docs

Out-of-bounds read in FreeRDP RDPEAR client NDR parsing

Priority LOW 39CWE-125Published · Updated

Key facts

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

Attack profile from CVSS 3.1 · GHSA-6rj3-rf6g-3vw5. Fix status from GitHub. Impact type from CWE-125 and the CVSS impact.

Summary

FreeRDP from 3.9.0 through 3.31.1 is affected in the client RDPEAR channel. The NDR scalar readers check for the required bytes before consuming alignment padding, so an unaligned stream can be read past its end (CWE-125). A malicious or compromised RDP server can control the payload received by a client using Remote Credential Guard, causing an out-of-bounds read and possibly process termination.

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

Description from the GitHub advisory

# [RDPEAR] NDR scalar length is checked before alignment, causing a client out-of-bounds read > Private security report. Please keep this report and its attachments private > during triage and remediation. ## Suggested advisory metadata - Product: FreeRDP / libfreerdp client RDPEAR - Affected versions: 3.9.0 through 3.31.1; current master at `4fa2b8efea2be8769e5499134f25182e64e13671` - Patched versions: none known - Weakness: CWE-125, Out-of-bounds Read - Suggested severity: Moderate - Conservative CVSS 3.1 vector: `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H` (5.3) ## Summary FreeRDP's RDPEAR NDR scalar readers check that a complete 16-, 32-, or 64-bit value remains **before** consuming NDR alignment padding. An unaligned stream can therefore pass the check, consume part of the checked bytes as padding, and perform the scalar read after too few bytes remain. I reproduced a seven-byte out-of-bounds `UINT64` read with a nine-byte root-cause input. I also reproduced the bug through the real `CreateApReqAuthenticatorReq` descriptor and deferred-pointer parser using a minimized 85-byte fuzzer input. The latter reaches `ndr_read_uint64()` for `SkewTime` and reads three bytes past the exact input object. As a sanitizer-independent check, I placed both streams immediately before a `PROT_NONE` guard page. Unsanitized GCC and Clang builds at `-O0` and `-O2` terminated with `SIGSEGV`; a GCC Release-equivalent `-O3 -DNDEBUG` LTO build also faulted through the production descriptor. The patched builds rejected the identical bytes without a signal. The guard page proves the boundary crossing but does not imply that every ordinary heap placement will crash. A malicious or compromised RDP server can control the decrypted RDPEAR payload received by a FreeRDP client using Remote Credential Guard. The demonstrated impact is a client-side out-of-bounds read and potential process termination. I am not claiming an out-of-bounds write, reliable memory disclosure, or code execution. ## Root cause In `channels/rdpear/common/ndr.c`, `SIMPLE_TYPE_IMPL` currently performs the checks in this order: ```c if (!Stream_CheckAndLogRequiredLength(TAG, s, sizeof(UPPERTYPE))) return FALSE; if (!ndr_read_align(context, s, sizeof(UPPERTYPE))) return FALSE; Stream_Read_UINT64(s, *v); ``` For a `UINT64` at NDR offset 1 with eight bytes remaining, the first check succeeds. Alignment then consumes seven bytes and the eight-byte scalar read starts with only one byte left, reading seven bytes beyond the buffer. The same primitive applies to the generated `uint16`, `uint32`, and `uint64` readers. The required invariant is: ```text validate and consume alignment -> validate scalar bytes -> read scalar ``` ## Production reachability The client path is: ```text rdpear_on_data_received() -> freerdp_nla_decrypt() -> ASN.1 contextual payload extraction -> rdpear_decode_payload() -> RemoteCallKerbCreateApReqAuthenticator dispatch -> ndr_read_CreateApReqAuthenticatorReq() -> ndr_treat_deferred_read() -> ndr_read_pointedMessageEx(SkewTime) -> ndr_read_uint64() ``` The client `/remoteGuard` option enables `FreeRDP_RemoteCredentialGuard` and extended security. RDPEAR is an optional build feature, but FreeRDP's nightly Debian and RPM configurations explicitly enable it. Authentication is not bypassed: the threat model is a user/application connecting to a malicious or compromised RDP server while this feature is active. ## Proof of concept Attachments: - `poc_ndr_alignment_oob.c`: minimal nine-byte root-cause harness - `poc_create_ap_req_oob.c`: real descriptor/deferred-parser harness - `poc_create_ap_req_input.h`: exact minimized 85-byte fuzzer input - `poc_ndr_alignment_guard_page.c`: unsanitized minimal boundary proof - `poc_create_ap_req_guard_page.c`: unsanitized descriptor boundary proof - `REPRODUCE.md`: build and run commands FreeRDP 3.31.1, minimal harness: ```text ERROR: AddressSanitizer: stack-buffer-overflow READ of size 1 #0 winpr_Data_Get_UINT64 winpr/endian.h:175 #1 stream_read_u64_le winpr/stream.h:297 #2 ndr_read_uint64 channels/rdpear/common/ndr.c:419 #3 main poc_ndr_alignment_oob.c:31 [32, 41) 'payload' Memory access at offset 47 overflows this variable ``` FreeRDP 3.31.1, production descriptor: ```text ERROR: AddressSanitizer: global-buffer-overflow READ of size 1 #0 winpr_Data_Get_UINT64 #1 stream_read_u64_le #2 ndr_read_uint64 #3 ndr_read_uint64_ #4 ndr_read_pointedMessageEx #5 ndr_treat_deferred_read #6 main Address is located 3 bytes after global variable 'rdpear_create_ap_req_fuzzer_input' of size 85 ``` The original libFuzzer artifact uses heap storage and produces the equivalent `heap-buffer-overflow`; the deterministic C array changes only ASan's storage class label. ## Fix direction and validation `PROPOSED_FIX.diff` moves `ndr_read_align()` before the scalar length check. `REGRESSION_TEST.diff` adds an aligned/truncated scalar case to `TestNdr`. With the fix applied: ```text ndr_read_uint64: invalid length, got 1, require at least 8 SAFE_REJECT ndr_read_uint64: invalid length, got 4, require at least 8 SAFE_DEFERRED_REJECT ``` Both existing RDPEAR test targets pass under ASan. A hardened follow-up run with this fix and the independently documented cleanup guard completed 1,781,846 libFuzzer executions over 601 seconds without another sanitizer crash. The open NDR refactoring PR #11588 currently carries the same vulnerable check-before-alignment ordering in `winpr/libwinpr/ndr/ndr.c`; the correction should be propagated there before that code is merged. ## Affected-version and duplicate review The ordering entered with Remote Credential Guard support in commit `a4bd5ba8863c0959501d4604159042a311dae85a`. The first containing release tag is 3.9.0, and all subsequent 3.x release tags through 3.31.1 contain the same code. I found no public report with this root cause after searching FreeRDP issues, PRs, commits, and published advisories for the exact scalar, alignment, and production-descriptor symbols. The nearby RDPEAR advisories for uint8-array count mismatch and ref-id aliasing have different root causes. Details are in `DUPLICATE_REVIEW.md`; private reports remain unsearchable, so maintainers must make the final duplicate determination. Reporter attribution: Han Sang-Kyung / HAN-BAMBO (`@HAN-BAMBO`)

Why it matters now

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

SSVC decision points

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

Affected products

VendorProductAffected versionsFixed inStatusSource
—FreeRDP (c/c++)>= 3.9.0, <= 3.31.13.32.0Patch availableGHSA-6rj3-rf6g-3vw5
  • FreeRDP (c/c++) Vendor— Affected >= 3.9.0, <= 3.31.1 Fixed in 3.32.0 Patch available GHSA-6rj3-rf6g-3vw5

Remediation

Update FreeRDP to version 3.32.0, which fixes the flaw.

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

  • Fix · GHSA-6rj3-rf6g-3vw5 FreeRDP (c/c++) Fixed in 3.32.0 Advisory →

Timeline

  1. 2026-11-12 Threatist record created from GHSA-6rj3-rf6g-3vw5

References

Sources

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