Skip to content
DoS Write-up Advanced

GhostTiles: How a Stale Frame ID Turned FreeRDP’s Progressive Codec into a Resource Amplifier

FreeRDP's Progressive codec failed to reset its tile-update list when the frame identifier stayed the same, so repeated valid updates accumulated tiles and caused quadratic repainting. A malicious RDP server could send a small amount of traffic to make the client consume excessive memory and CPU, and under memory pressure trigger a heap out-of-bounds write.

ts247091 Follow

Published on medium.com

Cybersecurity

Anmol Singh, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

FreeRDP is a widely used open-source implementation of the Remote Desktop Protocol. Among the channels it handles is RDP Graphics (RDPGFX), which carries tile-based screen updates. The Progressive codec decodes those tiles locally on the client, and the entry point for a Progressive surface update is progressive_decompress().

GhostTiles is a coordinated-disclosure write-up of GHSA-v7hr-xh82-79p7, a High-severity flaw in that pipeline. The advisory credits the reporter as poxsky. The issue is client-side: a FreeRDP-based client, including xfreerdp and applications that embed libfreerdp, decodes whatever a remote server sends. The client trusts the server to send screen updates, and the bug lets a small sequence of valid Progressive graphics updates make the client spend far more memory and CPU than the data should require.

Setup

The attack model is a malicious or attacker-controlled RDP server and a target that connects to it. The finding does not mean that any internet host can attack every FreeRDP client without a connection being initiated; the victim has to initiate the session.

The published advisory reports an end-to-end test against an unmodified xfreerdp client running version 3.32.2. The project lists 3.33.0 as the patched version, and its release history now includes 3.33.1 as well. The advisory was published on 9 November 2026 and currently lists no CVE ID.

Finding it

The decoder keeps a per-surface frame identifier and an array of updated tile indices, a list of tiles to repaint. It clears that list only when the frame identifier changes. The reset lives inside a "frame identifier changed" branch.

That condition assumes the frame identifier will advance between the calls that need a fresh tile-update batch. But the relevant Wire-to-Surface-2 command contains a complete Progressive frame, and a server can keep the identifier constant. If the server reuses the same identifier, or sends no StartFrame PDU at all, leaving the client's frame identifier at zero, the list is not cleared between complete surface updates. The old tile indices remain in the batch.

Exploitation

Step 1: keep the frame identifier constant

The server sends a sequence of valid Progressive graphics updates without advancing the frame identifier. Because the reset only happens on a change, the tile-update batch survives from one complete surface update to the next.

Step 2: let the batch accumulate

For every repeated frame, the decoder adds that frame's tiles to the list and calls the drawing routine over the full list. A simplified model from the write-up:

Text
frame 1: repaint T tilesframe 2: repaint 2T tilesframe 3: repaint 3T tiles...frame N: repaint N×T tiles

The total work across N repeated frames is proportional to T × (1 + 2 + … + N), which grows as O(TN²). Each update revisits all earlier tile entries, so the work accumulates roughly quadratically. A normal frame identifier change clears the batch and avoids this accumulation; the attack sequence keeps it from changing.

Step 3: measure the amplification

In the advisory's end-to-end test against unmodified xfreerdp 3.32.2, 12.3 MB of server traffic increased the client's resident memory from about 2.2 MB to about 2.29 GB in roughly nine seconds. The processing time per command increased from about 20 ms to about 90 ms. With a 1.8 GB address-space limit, the client crashed after roughly 145 commands.

A control test that advanced the frame identifier kept memory approximately flat. That comparison supports the stale-identifier reset condition as the cause of the amplification. These numbers describe the project's published test setup; results can vary with build options, platform and available memory.

Step 4: push into memory corruption

The advisory documents a second part of the chain. Tile-cache growth used multiple allocations. During a failed growth operation, the cache's recorded size could be advanced before all dependent allocations had succeeded. Later bounds checks could then trust a capacity value that no longer matched the actual allocated storage. Under allocation failure, a subsequent tile-index write could go out of bounds.

The project reports an AddressSanitizer-confirmed four-byte heap write under fault injection, as well as a crash in a constrained production-style run. The public report does not demonstrate code execution; the confirmed impact is resource exhaustion and a memory-corruption condition under memory pressure.

Another aggravating behaviour was that some decoder failure paths returned success to the caller. That could hide an internal failure from the surrounding client code while decoding continued.

Root cause

The mistake is the placement of the reset. The update counter is reset only inside the "frame identifier changed" branch, so the decoder's assumption that the identifier advances between calls is wrong for a server that keeps it constant or omits StartFrame. The tile-update batch is therefore never cleared between complete surface updates, and each new update adds to the old list while the drawing routine repaints the entire growing list.

The second defect is in tile-cache growth: the recorded size could be advanced before all dependent allocations had succeeded, so later bounds checks trusted a capacity that no longer matched the allocated storage. The failure-path behaviour, returning success on some decoder errors, could hide an internal failure from the surrounding client code while decoding continued.

Impact

An attacker who operates or controls an RDP server, and gets a target to connect to it, can drive the client's memory and CPU far beyond what the received data should cost. In the published test, 12.3 MB of traffic produced roughly 2.29 GB of resident memory in about nine seconds, and the client crashed under a 1.8 GB address-space limit after roughly 145 commands.

Under allocation failure, the same chain can produce an out-of-bounds four-byte heap write, confirmed by AddressSanitizer under fault injection, and a crash in a constrained production-style run. The public report does not demonstrate code execution. The confirmed impact is resource exhaustion and a memory-corruption condition under memory pressure.

Fix

The project's advisory describes two main fixes: reset the tile-update batch for each complete surface command, and make tile-cache growth transactional. The first prevents old tile entries from accumulating across commands. The second keeps the decoder's bookkeeping consistent if an allocation fails partway through growth.

Upgrade to FreeRDP 3.33.0 or later. Check the version of the FreeRDP libraries your application actually uses; a front-end update alone may not update an independently installed or bundled libfreerdp.

Variants to test

  1. Reused frame identifier on other RDPGFX paths. Send complete Progressive surface updates with a constant frame identifier and watch client memory and per-command processing time. A positive result is memory that grows with the number of frames rather than staying flat, and per-command time that climbs as the batch grows.
  2. No StartFrame PDU. Omit StartFrame so the client's frame identifier stays at zero, then send repeated updates. A positive result is the same accumulation as with a reused identifier.
  3. Control comparison. Repeat the sequence while advancing the frame identifier each time. A positive result for the bug is a clear difference: flat memory in the control, growth in the attack sequence.
  4. Allocation-failure paths in tile-cache growth. Run the decoder under fault injection with a memory limit and watch for out-of-bounds writes in the tile-index handling. A positive result is an AddressSanitizer report on a heap write during growth failure.
  5. Error propagation. Trigger decoder failure paths and check whether the caller receives success. A positive result is a failure that is reported as success while decoding continues.

Do not test systems without authorisation. The write-up intentionally omits a runnable attack server or payload.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 14 min read.

What happened, in plain words

Imagine you use a program on your computer to look at another computer's screen over the internet. That is what remote desktop software does: your machine shows a live picture of a distant machine, and you click and type as if you were sitting in front of it. To make that picture appear, the distant computer sends your computer a stream of small image pieces, and your computer draws them on your screen.

FreeRDP is one popular, free program that does this. It speaks a language called the Remote Desktop Protocol, or RDP. One part of that language is called RDP Graphics, or RDPGFX, and it carries the picture pieces, called tiles. A piece of FreeRDP called the Progressive codec is the part that turns those tiles back into a picture on your screen.

GhostTiles is the name given to a bug in that picture-drawing part. The bug was reported to the FreeRDP project and is now written up publicly as GHSA-v7hr-xh82-79p7. The project rates it High severity. The advisory credits the person who reported it as poxsky.

The important thing to understand first: in this setup, your computer trusts the distant computer to send sensible picture updates. The bug lets a malicious distant computer send a small amount of perfectly valid-looking picture data that makes your computer use far more memory and processing power than that data should ever need. It is like someone handing you a short shopping list and you ending up carrying a truckload of goods.

This is a client-side problem. That means the weakness is in the program on the victim's machine, not in the server. But the attacker has to be the one running the server, and the victim has to choose to connect to it. It is not the case that any random computer on the internet can attack every FreeRDP user out of nowhere; a connection has to be started first.

The pieces you need to know

Before the details make sense, here are the basic ideas, explained from zero.

  • Remote Desktop Protocol (RDP): a set of rules two computers follow so one can show and control the other's screen. Think of it as a shared language for screen sharing.
  • Client and server: the client is the program on your machine that you look at. The server is the machine (or program) sending the screen. In this story the server is the potential attacker and the client is the potential victim.
  • Codec: a piece of software that compresses and decompresses data. Screen pictures are big, so they are squeezed down before sending and expanded again on arrival. The Progressive codec is the one that handles these tile-based screen updates.
  • Tile: a small rectangular patch of screen. Instead of sending a whole screen, the server sends only the tiles that changed.
  • Channel: a separate lane of traffic inside one connection. RDP has several; RDPGFX is the lane that carries graphics.
  • Memory (RAM): the working space a program uses while running. If a program uses too much, the computer slows down or the program crashes.
  • CPU: the part of the computer that does the actual work. More work means more time and more heat.
  • Frame identifier: a number attached to each batch of screen updates, like a page number in a booklet. The client uses it to tell one batch from the next.
  • PDU (Protocol Data Unit): a single message in a network conversation. StartFrame PDU is the message that announces the beginning of a new frame.
  • Allocation: asking the operating system for a chunk of memory. When a program needs space, it requests an allocation.
  • Out-of-bounds write: writing data past the end of the space that was reserved for it. It is like writing in the margin of a form and accidentally scribbling on the next page.
  • AddressSanitizer: a tool that watches a running program and shouts when it sees memory being used incorrectly.
  • CVE ID: a public catalogue number for a known security flaw. This advisory currently lists none.

What is affected

FreeRDP is a widely used, open-source implementation of RDP. Among the lanes it handles is RDPGFX, which carries tile-based screen updates. The Progressive codec decodes those tiles locally on the client, and the entry point for a Progressive surface update is a function called progressive_decompress().

A function is a named block of code that does one job. Think of it as a labelled drawer in a filing cabinet: when the program needs that job done, it opens that drawer. progressive_decompress() is the drawer that unpacks a Progressive screen update.

FreeRDP-based clients, including xfreerdp and applications that embed libfreerdp, may be affected when they connect to a malicious RDP server running the vulnerable code. xfreerdp is the command-line FreeRDP client. libfreerdp is the underlying library that other programs can build on, the way a car maker might use a shared engine design.

The client trusts the server to send screen updates, and the bug lets a small sequence of valid Progressive graphics updates make the client spend far more memory and CPU than the data should require.

Setup: who attacks whom

The attack model is a malicious or attacker-controlled RDP server and a target that connects to it. The finding does not mean that any internet host can attack every FreeRDP client without a connection being initiated; the victim has to initiate the session.

In everyday terms: someone has to set up a fake remote desktop service, and you have to point your client at it and connect. That is why this is not a flaw you can be hit by simply by having FreeRDP installed.

The published advisory reports an end-to-end test against an unmodified xfreerdp client running version 3.32.2. The project lists 3.33.0 as the patched version, and its release history now includes 3.33.1 as well. The advisory was published on 9 November 2026 and currently lists no CVE ID.

Finding it: the stale list

The decoder keeps a per-surface frame identifier and an array of updated tile indices, a list of tiles to repaint. It clears that list only when the frame identifier changes. The reset lives inside a "frame identifier changed" branch.

A branch is a fork in the code: if a condition is true, do one thing; otherwise do another. Here the condition is "has the frame identifier changed?" and the reset only happens on the yes side.

That condition assumes the frame identifier will advance between the calls that need a fresh tile-update batch. But the relevant Wire-to-Surface-2 command contains a complete Progressive frame, and a server can keep the identifier constant. If the server reuses the same identifier, or sends no StartFrame PDU at all, leaving the client's frame identifier at zero, the list is not cleared between complete surface updates. The old tile indices remain in the batch.

A useful comparison: imagine a cleaner who only empties the bin when the date on the bin changes. If the date never changes, the bin is never emptied, and every new piece of rubbish is piled on top of the old.

Exploitation: how the bug is triggered

Step 1: keep the frame identifier constant

The server sends a sequence of valid Progressive graphics updates without advancing the frame identifier. Because the reset only happens on a change, the tile-update batch survives from one complete surface update to the next.

Why do this? Because the client's cleanup step is tied to the identifier changing. If the identifier never changes, the cleanup never runs, and the old list of tiles stays in place.

Step 2: let the batch accumulate

For every repeated frame, the decoder adds that frame's tiles to the list and calls the drawing routine over the full list. A simplified model from the write-up:

Text
frame 1: repaint T tilesframe 2: repaint 2T tilesframe 3: repaint 3T tiles...frame N: repaint N×T tiles

Line by line, in plain words:

  • frame 1: repaint T tiles means the first batch adds T tiles to the list, and the client redraws those T tiles.
  • frame 2: repaint 2T tiles means the second batch adds another T tiles, and the client now redraws all 2T tiles, old and new.
  • frame 3: repaint 3T tiles means the third batch adds another T, and the client redraws all 3T.
  • ... means this keeps going.
  • frame N: repaint N×T tiles means by the Nth batch the client is redrawing N times T tiles, even though each individual batch only carried T.

The total work across N repeated frames is proportional to T × (1 + 2 + … + N), which grows as O(TN²). In plain words: the amount of work grows with the square of the number of frames. Doubling the number of frames roughly quadruples the work. A normal frame identifier change clears the batch and avoids this accumulation; the attack sequence keeps it from changing.

Step 3: measure the amplification

In the advisory's end-to-end test against unmodified xfreerdp 3.32.2, 12.3 MB of server traffic increased the client's resident memory from about 2.2 MB to about 2.29 GB in roughly nine seconds. The processing time per command increased from about 20 ms to about 90 ms. With a 1.8 GB address-space limit, the client crashed after roughly 145 commands.

Resident memory is the amount of RAM the program is actually holding at that moment. Address-space limit is a cap on how much memory the program is allowed to ask for. A crash means the program stopped working, usually because it hit that cap.

To put the numbers in perspective: 12.3 MB is roughly the size of a few photos. It produced about 2.29 GB of memory use, which is more than a thousand times larger. That is the amplification the title refers to.

A control test that advanced the frame identifier kept memory approximately flat. A control test is a comparison run where you change one thing to prove it is the cause. Here, advancing the identifier is the normal, healthy behaviour, and memory stayed flat. That comparison supports the stale-identifier reset condition as the cause of the amplification. These numbers describe the project's published test setup; results can vary with build options, platform and available memory.

Step 4: push into memory corruption

The advisory documents a second part of the chain. Tile-cache growth used multiple allocations. During a failed growth operation, the cache's recorded size could be advanced before all dependent allocations had succeeded. Later bounds checks could then trust a capacity value that no longer matched the actual allocated storage. Under allocation failure, a subsequent tile-index write could go out of bounds.

A cache is a temporary store of things you expect to need again. A bounds check is a safety test that asks "is this write still inside the space I reserved?" If the recorded size says there is room but the real reserved space is smaller, the check gives the wrong answer, and the write lands outside its box.

The project reports an AddressSanitizer-confirmed four-byte heap write under fault injection, as well as a crash in a constrained production-style run. Fault injection means deliberately making something fail (here, memory allocation) to see how the program copes. The heap is the general pool of memory a program uses for data that grows and shrinks at runtime. The public report does not demonstrate code execution; the confirmed impact is resource exhaustion and a memory-corruption condition under memory pressure.

Another aggravating behaviour was that some decoder failure paths returned success to the caller. That could hide an internal failure from the surrounding client code while decoding continued. In everyday terms: a worker reports "all done, no problems" even though something went wrong, so nobody upstairs notices until much later.

Root cause: where the mistake lives

The mistake is the placement of the reset. The update counter is reset only inside the "frame identifier changed" branch, so the decoder's assumption that the identifier advances between calls is wrong for a server that keeps it constant or omits StartFrame. The tile-update batch is therefore never cleared between complete surface updates, and each new update adds to the old list while the drawing routine repaints the entire growing list.

The second defect is in tile-cache growth: the recorded size could be advanced before all dependent allocations had succeeded, so later bounds checks trusted a capacity that no longer matched the allocated storage. The failure-path behaviour, returning success on some decoder errors, could hide an internal failure from the surrounding client code while decoding continued.

Impact: what an attacker gets

An attacker who operates or controls an RDP server, and gets a target to connect to it, can drive the client's memory and CPU far beyond what the received data should cost. In the published test, 12.3 MB of traffic produced roughly 2.29 GB of resident memory in about nine seconds, and the client crashed under a 1.8 GB address-space limit after roughly 145 commands.

Under allocation failure, the same chain can produce an out-of-bounds four-byte heap write, confirmed by AddressSanitizer under fault injection, and a crash in a constrained production-style run. The public report does not demonstrate code execution. The confirmed impact is resource exhaustion and a memory-corruption condition under memory pressure.

Resource exhaustion means using up memory or processing power until the program cannot continue. Memory corruption means data was written where it should not have been. The report stops short of showing that this corruption can be turned into running an attacker's code.

Fix: what changed

The project's advisory describes two main fixes: reset the tile-update batch for each complete surface command, and make tile-cache growth transactional. The first prevents old tile entries from accumulating across commands. The second keeps the decoder's bookkeeping consistent if an allocation fails partway through growth.

Transactional here means all-or-nothing, like a bank transfer that either completes fully or leaves the balance untouched. If part of the memory growth fails, the recorded size is rolled back so it still matches reality.

Upgrade to FreeRDP 3.33.0 or later. Check the version of the FreeRDP libraries your application actually uses; a front-end update alone may not update an independently installed or bundled libfreerdp. In plain words: updating the app you see on screen is not enough if the underlying library was installed separately or shipped inside another program.

Variants to test

  1. Reused frame identifier on other RDPGFX paths. Send complete Progressive surface updates with a constant frame identifier and watch client memory and per-command processing time. A positive result is memory that grows with the number of frames rather than staying flat, and per-command time that climbs as the batch grows.
  2. No StartFrame PDU. Omit StartFrame so the client's frame identifier stays at zero, then send repeated updates. A positive result is the same accumulation as with a reused identifier.
  3. Control comparison. Repeat the sequence while advancing the frame identifier each time. A positive result for the bug is a clear difference: flat memory in the control, growth in the attack sequence.
  4. Allocation-failure paths in tile-cache growth. Run the decoder under fault injection with a memory limit and watch for out-of-bounds writes in the tile-index handling. A positive result is an AddressSanitizer report on a heap write during growth failure.
  5. Error propagation. Trigger decoder failure paths and check whether the caller receives success. A positive result is a failure that is reported as success while decoding continues.

Do not test systems without authorisation. The write-up intentionally omits a runnable attack server or payload.

Glossary

  • Address-space limit: a cap on how much memory a program is allowed to request from the operating system.
  • AddressSanitizer: a debugging tool that detects incorrect memory use, such as writes outside reserved space.
  • Allocation: a request to the operating system for a block of memory.
  • Array: an ordered list of items stored together, here the list of tile indices to repaint.
  • Bounds check: a safety test that confirms a read or write stays inside the space that was reserved.
  • Branch: a point in code where the program chooses between paths based on a condition.
  • Cache: a temporary store of data kept for quick reuse.
  • Client: the program on the user's machine that connects to a server and displays its screen.
  • Codec: software that compresses and decompresses data, here screen tiles.
  • Control test: a comparison run where one factor is changed to show it causes the observed effect.
  • CPU: the processor that performs the computer's work; more work means more time.
  • CVE ID: a public catalogue number assigned to a known security vulnerability.
  • Fault injection: deliberately causing a failure (such as an allocation failure) to observe how software behaves.
  • Frame identifier: a number attached to a batch of screen updates, used to tell batches apart.
  • FreeRDP: an open-source implementation of the Remote Desktop Protocol.
  • Heap: the general pool of memory a program uses for data whose size changes at runtime.
  • libfreerdp: the FreeRDP library that other applications can embed.
  • Memory corruption: a condition where data is written to a place it should not be, potentially changing other data.
  • Out-of-bounds write: writing data past the end of the space reserved for it.
  • PDU (Protocol Data Unit): a single message exchanged in a network protocol.
  • Progressive codec: the FreeRDP component that decodes tile-based Progressive screen updates.
  • progressive_decompress(): the function that unpacks a Progressive surface update.
  • RDP (Remote Desktop Protocol): the rules two computers follow so one can display and control the other's screen.
  • RDPGFX (RDP Graphics): the RDP channel that carries graphics and tile updates.
  • Resident memory: the amount of RAM a running program is currently holding.
  • Resource exhaustion: using up memory or processing power until a program can no longer continue.
  • Server: the machine or program sending the screen to a client; in this attack, the attacker-controlled side.
  • StartFrame PDU: the message that announces the start of a new frame.
  • Tile: a small rectangular patch of screen sent as an update.
  • Transactional: all-or-nothing; a change either completes fully or is rolled back.
  • Wire-to-Surface-2 command: the RDPGFX command that carries a complete Progressive frame to the client.
  • xfreerdp: the command-line FreeRDP client.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.