fix(pdu): harden framing and empty output handling - #1515
Merged
Marc-André Moreau (mamoreau-devolutions) merged 1 commit intoAug 2, 2026
Merged
fix(pdu): harden framing and empty output handling#1515Marc-André Moreau (mamoreau-devolutions) merged 1 commit into
Marc-André Moreau (mamoreau-devolutions) merged 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Marc-André Moreau (mamoreau-devolutions)
August 2, 2026 18:11
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Hardens RDP frame validation while supporting zero-length empty output PDUs.
Changes:
- Rejects undersized TPKT and Fast-Path frames.
- Accepts empty Update and Pointer output PDUs with zero
totalLength. - Adds regression tests for malformed and compatible framing.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
crates/ironrdp-pdu/src/tpkt.rs |
Validates minimum TPKT size. |
crates/ironrdp-pdu/src/rdp/headers.rs |
Handles empty output PDUs and adds tests. |
crates/ironrdp-pdu/src/lib.rs |
Validates Fast-Path lengths and tests malformed frames. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Marc-André Moreau (mamoreau-devolutions)
merged commit Aug 2, 2026
33506e6
into
master
27 checks passed
Marc-André Moreau (mamoreau-devolutions)
deleted the
fix-pdu-framing-empty-output
branch
August 2, 2026 18:36
Marc-André Moreau (mamoreau-devolutions)
added a commit
that referenced
this pull request
Aug 2, 2026
Reject Fast-Path and TPKT frames whose declared length is smaller than their header or minimum packet size. Also tolerate the zero-length `totalLength` variation used by empty Update and Pointer output PDUs, while continuing to reject zero-length non-output data PDUs. Adds regression coverage for malformed frame lengths and empty output compatibility. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
GlassOnTin
added a commit
to GlassOnTin/IronRDP
that referenced
this pull request
Aug 3, 2026
`ShareControlHeader::decode` rejects a Data PDU whose `totalLength` is smaller than the unit it decoded. That check costs whole sessions against VirtualBox VRDP, which declares 24 on a complete 8550-byte slow-path pointer update. `totalLength` is consulted here for exactly one purpose: locating trailing padding after the inner unit ([MS-RDPBCGR] 2.2.8.1.1.1.1). A value smaller than what was decoded therefore means there is no padding to skip, and nothing more. It is not grounds to reject the PDU — the inner unit already decoded within the cursor's bounds, and where the PDU ends is decided by the transport framing (the TPKT or fast-path length), never by this field. Deliberately narrow: a `totalLength` of zero stays rejected for anything but the no-op output PDUs Devolutions#1515 allowed. A field that is absent entirely is a different signal from one that is merely wrong, and Devolutions#1515 drew that line three days ago; this does not move it. All three of its tests still pass unchanged. Tests: the reporter's real frame shape (8565 bytes on the wire, 8550 of MCS user data, totalLength 24) now decodes; zero-length leniency is asserted not to have widened; over-declared padding is still consumed, and declared-but-absent padding still errors. Verified to fail — restoring the strict branch reddens the under-declared test and leaves the three guard tests green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reject Fast-Path and TPKT frames whose declared length is smaller than their header or minimum packet size. Also tolerate the zero-length
totalLengthvariation used by empty Update and Pointer output PDUs, while continuing to reject zero-length non-output data PDUs.Adds regression coverage for malformed frame lengths and empty output compatibility.