## Summary
`ironrdp-rdpeusb` has no fuzz coverage, even though it decodes
attacker-controlled **client→server** PDUs off two DVC channels. The
device
channel in particular carries URB completions, IO-control completions
and
interface-info results whose **length-prefixed payloads must be
bounds-checked
before they're read** — historically a good place for unchecked-read
panics.
(A downstream server built on `ironrdp-server`,
[macrdp](https://github.com/clintcan/macrdp),
hit exactly that class of panic in these decoders in the past, which is
what
motivated adding coverage here.)
This adds a fuzz target for the two top-level client PDU families a
server
decodes off the wire.
## What's added
- **Oracle** `oracles::rdpeusb_decode` — decodes the two client→server
entry
points via `ironrdp_core::decode`:
- `UrbdrcClientControlPdu` (main-channel family)
- `UrbdrcClientDevicePdu<Raw>` (per-device family — recursively
exercises the
URB / IO-control / interface-info result payloads)
- **Fuzz target** `fuzz/fuzz_targets/rdpeusb_decode.rs` (auto-discovered
by
`cargo xtask fuzz list`, so it joins the CI matrix with no further
wiring).
- **Regression check** `check_rdpeusb_decode` in `fuzz_regression.rs`,
plus the
`rdpeusb_decode/` corpus folder, so any crash found becomes a permanent
replay test.
## Verification
- `cargo build -p ironrdp-fuzzing` — the oracle compiles against the
real API.
- `cargo test -p ironrdp-testsuite-core check_rdpeusb_decode` — passes.
- `cargo fmt --all -- --check` (stable + nightly) clean; `cargo clippy
-p ironrdp-fuzzing` clean.
- `cargo xtask fuzz list` lists `rdpeusb_decode`.
Purely additive (a new oracle, target, regression check + the
`ironrdp-rdpeusb`
dev-dependency of `ironrdp-fuzzing`); no existing code changes.
Complements the
in-flight rdpeusb server work by giving the crate's decode surface
ongoing
fuzzing.
Co-authored-by: Clint Christopher Canada <clint.canada@clubitech.com>
## Summary
- Add portable MS-RDPEFS/MS-FSCC filesystem request and completion
codecs with malformed-input validation and wire tests.
- Keep RDPDR runtime dispatch, Windows-native backend implementation,
and client/session integration out of this foundation.
## Follow-up
Later stacked PRs provide the backend implementation and runtime
integration.
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Bumps the patch group with 1 update in the / directory:
[clap](https://github.com/clap-rs/clap).
Updates `clap` from 4.6.4 to 4.6.5
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/releases">clap's
releases</a>.</em></p>
<blockquote>
<h2>v4.6.5</h2>
<h2>[4.6.5] - 2026-07-31</h2>
<h3>Fixes</h3>
<ul>
<li><em>(help)</em> Correctly mark which <code>value_names</code> are
optional with <code>num_args</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's
changelog</a>.</em></p>
<blockquote>
<h2>[4.6.5] - 2026-07-31</h2>
<h3>Fixes</h3>
<ul>
<li><em>(help)</em> Correctly mark which <code>value_names</code> are
optional with <code>num_args</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/clap-rs/clap/commit/c8c935504a3f1a015470199ae82c3cb124b5b1d5"><code>c8c9355</code></a>
chore: Release</li>
<li><a
href="https://github.com/clap-rs/clap/commit/af74def7141738c51ace956f58eb32dd94e998ab"><code>af74def</code></a>
docs: Update changelog</li>
<li><a
href="https://github.com/clap-rs/clap/commit/c96f222c35c4ef4bd3ab9927809b2724532a8f6e"><code>c96f222</code></a>
Merge pull request <a
href="https://redirect.github.com/clap-rs/clap/issues/6368">#6368</a>
from truffle-dev/fix/fish-env-escaping</li>
<li><a
href="https://github.com/clap-rs/clap/commit/49a05cdc99c2151cdd48d5ec4c974151d21c026e"><code>49a05cd</code></a>
fix(complete): Two-pass quote fish env-completer</li>
<li><a
href="https://github.com/clap-rs/clap/commit/e791004a5bbbfe5418fe573a4db777df24d72490"><code>e791004</code></a>
test(complete): Snapshot fish env quoting cases</li>
<li>See full diff in <a
href="https://github.com/clap-rs/clap/compare/clap_complete-v4.6.4...clap_complete-v4.6.5">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This change adds an assertion-or-panic fuzz oracle for the AVC
length-prefix to Annex-B conversion that runs inside
`OpenH264Decoder::decode` before any OpenH264 entry point. The same
change refactors the conversion from a private method on
`OpenH264Decoder` into two public free functions in
`ironrdp_egfx::pdu::avc`. The first function, `avc_to_annex_b`,
returns a fresh `Vec<u8>` and is symmetric with the existing
`annex_b_to_avc`. The second function, `avc_to_annex_b_into`, writes
into a caller-provided buffer and preserves the per-frame buffer-reuse
optimization that `OpenH264Decoder` relied on.
The conversion is now available unconditionally to any consumer of
`ironrdp-egfx`. The previous `#[cfg(feature = "openh264")]` gating
went with the location, not the bytes-to-bytes logic, so lifting the
function out of `decode.rs` removed the gate too.
The new oracle exercises two input distributions on every fuzz call:
- Direct path: the oracle calls `avc_to_annex_b(data)` on the raw fuzz
input. This exercises the wrapper on arbitrary byte distributions,
including inputs that do not parse as `Avc420BitmapStream`.
- Decode-chain path: the oracle tries
`Avc420BitmapStream::decode(data)`;
on success it calls `avc_to_annex_b(stream.data)`. This exercises the
wrapper on the realistic post-decode payload distribution.
The oracle catches panics in the wrapper, OOM allocation from
attacker-controlled NAL length encoding, and contract violations on the
produced Annex-B byte stream. The oracle does NOT catch OpenH264
internal bugs (OSS-Fuzz coverage), the YUV-to-RGBA conversion path
downstream of OpenH264 (separate workstream), or AVC444 luma plus
chroma split (sibling target).
Smoke fuzz ran 10,922,695 iterations in 31 seconds at ~352K exec/s
sustained with zero crashes. Coverage settled at 158 lines, 456
features, 69 corpus entries.
The new target auto-discovers into CI via the `cargo xtask fuzz list`
dynamic fan-out mechanism. The new `check_egfx_avc420_decode`
regression-replay test in
`crates/ironrdp-testsuite-core/tests/fuzz_regression.rs` runs against
the seed corpus and passes.
Refs #1316.
> **Rebased onto post-#1522 master.** #1509 landed the server half of
#1508 while this was open, including the `ClientAutoReconnect`
structure. This PR no longer declares it; it extends it, and picks up
the parts #1509 did not build.
## What
The client half of automatic reconnection. The session layer surfaces
the Server Auto-Reconnect Cookie, `ironrdp-pdu` derives and verifies the
client's response to it, and the connector sends that response when
resuming a session.
## Why
A client whose connection drops ungracefully can reattach to its session
instead of making the user log on again, provided it returns the cookie
the server issued during logon ([MS-RDPBCGR] 1.3.1.5).
#1509 built the server side of that: it validates a returning
`ARC_CS_PRIVATE_PACKET` and rotates the random. Nothing answers it.
`ironrdp-session` decodes the cookie and drops it, `ironrdp-connector`
has no way to send one back, and `TODO(#271)` still sits in
`ironrdp-client`. So `ironrdp-client` cannot resume a session against
`ironrdp-server`, and the validation #1509 added has no in-tree
counterpart to exercise it.
The wire encoding was already there. `ExtendedClientOptionalInfo`
carries, encodes and decodes a 28-byte `autoReconnectCookie` and its
builder already had a `reconnect_cookie` step; `ServerAutoReconnect`
already decoded; #1509 added `ClientAutoReconnect` and its decode.
Nothing connected them.
## The three parts
**Receive.** `SaveSessionInfo` now also surfaces the cookie, as
`ProcessorOutput::AutoReconnectCookie` and
`ActiveStageOutput::AutoReconnectCookie`. #1522 added a `SaveSessionInfo
{ logon_complete }` output on that same handler; the two coexist rather
than compete, since both are read off one PDU and neither supersedes the
other. The handler emits the logon notification unconditionally and
appends the cookie when one is present, and a test pins that surfacing
the cookie does not suppress the notification. #1509's server replaces
the cookie whenever a client connects and again hourly ([MS-RDPBCGR]
3.3.6.2), so this can arrive more than once in a session and the
consumer keeps the most recent.
**Derive.** `ClientAutoReconnect::from_server_cookie` implements
[MS-RDPBCGR] 5.5:
> The auto-reconnect random is used to key the HMAC function
([RFC2104]), which uses MD5 as the iterative hash function. The security
verifier is derived by applying the HMAC to the client random received
in Step 3.
>
> `SecurityVerifier = HMAC(AutoReconnectRandom, ClientRandom)`
>
> When Enhanced RDP Security is in effect the client random value is not
generated (section 5.3.2). In this case, for the purpose of generating
the security verifier, the client random is assumed to be an array of 32
zero bytes.
IronRDP implements no Standard RDP Security path (there is no Security
Exchange PDU), so the zero-client-random case is the only one that
arises. As 5.5 notes, that makes the verifier constant for a given
cookie, so it proves possession of the cookie and nothing more; session
security comes from the outer TLS/CredSSP handshake.
@clintcan independently confirmed this construction against real
**mstsc** while validating #1509
([comment](https://github.com/Devolutions/IronRDP/pull/1509#issuecomment-5151200681)):
a Windows client's `ARC_CS_PRIVATE_PACKET` verifies against
`HMAC-MD5(random_bits, [0u8; 32])`. That is the same derivation
implemented here, so the two halves interoperate with Microsoft's client
and not only with each other.
**Send.** `ClientConnector::with_auto_reconnect_cookie` takes the cookie
last received and makes the connector put the derived Client
Auto-Reconnect Packet ([MS-RDPBCGR] 2.2.4.3) in the Client Info PDU.
Absent, that PDU is byte-for-byte what it was.
Unlike the server packet, this structure has no enclosing logon-info
field header, so it encodes to exactly the 28 bytes the cookie field
expects. `to_bytes` writes that layout directly rather than going
through `Encode`, so filling a fixed-size field has no error path a
caller must handle; a test pins the two to agree.
## One derivation, not two
Putting `from_server_cookie` in `ironrdp-pdu` would leave the workspace
with two implementations of 5.5, since #1509 added a private HMAC to
`ironrdp-server`. So `ClientAutoReconnect` also gains `verify`, and the
server routes through it.
`verify` keeps the constant-time comparison the server had. The verifier
is the whole credential, so a comparison returning early on the first
differing byte would let a peer recover it a byte at a time from the
timing; the session identifier is not secret and is compared normally.
`ironrdp-server` keeps the policy around the check, which cookies are
live and whether the security protocol permits auto-reconnect, and drops
its `hmac` and `md-5` dependencies. `hmac` moves to `ironrdp-pdu` as
`default-features = false`; the crate's full feature powerset still
checks clean, including `--no-default-features`.
I would rather not have reached into `ironrdp-server` in a
`pdu,session,connector` change, but the alternative was shipping the
duplicate and filing a follow-up to remove it, which is a worse trade
for reviewer time.
## Tests that were not running
That move also rehomes the known-answer tests @clintcan contributed on
#1509. They went in as an inline `#[cfg(test)]` module in
`crates/ironrdp-server/src/server.rs`, and that crate sets `[lib] test =
false`, so they have never executed in CI. They now live in
`ironrdp-testsuite-core` against the public API, where CI runs them: his
HMAC-MD5 reference vector is kept as a second vector alongside a
differently-keyed one, plus the cases for a tampered verifier and a
mismatched logon ID.
Worth flagging separately: `ironrdp-server` is not alone.
`ironrdp-agent`, `ironrdp-session` and `ironrdp-web` also set `[lib]
test = false` and between them carry 16 files of inline `#[cfg(test)]`
modules that CI never runs. That is out of scope here, but I am happy to
open an issue if it would be useful.
## Breaking changes
`ActiveStageOutput` and `x224::ProcessorOutput` gain a variant, and
`ClientConnector` gains a public field, so exhaustive matches and struct
literals need updating.
Confirmed with `cargo-semver-checks` against the merge-base: those three
are the only findings this branch introduces. The others it reports on
`master` today (`ShareDataPdu::Compressed` and the `ShareDataCtx` fields
from #1518, `ProcessorBuilder.bulk_decompressor` from #1518,
`ServerEvent::SetAutoReconnectCookie` from #1509) are present on
`master` unchanged. The `ironrdp-pdu` additions are additive.
## Scope
This is the library half. `ironrdp-client`, `ironrdp-web` and the FFI
bindings gain an arm for the new output but none of them reconnect
automatically yet; that is the remaining part of #271, and the existing
`TODO(#271)` in `ironrdp-client` marks where it goes.
I kept receive, derive and send together deliberately. Split up, none of
them is usable on its own: without the receive half there is no way to
obtain a cookie, and without the send half there is nothing to do with
one.
## Tests
Thirteen, all in `ironrdp-testsuite-core`.
On the packet and the derivation: the `SecurityVerifier` matches two
independently computed HMAC-MD5 vectors of 32 zero bytes under different
keys, so the tests pin the derivation rather than restating the code;
the logon ID carries over from the server cookie; the encoding matches
the 2.2.4.3 field layout byte for byte with `cbLen` fixed at `0x1C`;
`to_bytes` agrees with `Encode`; it round-trips; and it rejects both a
wrong packet length and an unknown version.
On verification: a derived answer is accepted, a single flipped byte in
the verifier is rejected, a correct verifier under a different logon ID
is rejected, and an answer derived from a different random is rejected.
On the surfacing path: a Save Session Info PDU framed the way a server
sends it, through the real x224 processor, yields an
`AutoReconnectCookie` carrying the right logon ID and random bits,
alongside #1522's logon notification rather than in place of it; and one
without a cookie surfaces no cookie.
## Verification
`cargo xtask check fmt/lints/tests/typos/locks` all pass on 1.94.1,
including a `fuzz/` build before the lock check.
## Note
#1496 also touches the `ClientAutoReconnect` declaration. Whichever of
the two lands second needs a one-line rebase on the derive attribute;
happy to take that in either order.
[MS-RDPBCGR]:
https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/e729948a-3f4e-4568-9aef-d355e30b5389
[RFC2104]: https://www.rfc-editor.org/rfc/rfc2104
## Summary
On the WASM web client, frame **decode** dominates (~93% of frame time
on a 1080p RemoteFX replay), and within decode the **RFX inverse DWT was
~48%** (the YCbCr→RGBA convert is already SIMD via `yuv`; the
entropy/RLE stages are inherently sequential). This vectorizes the
inverse DWT with the portable [`wide`](https://crates.io/crates/wide)
crate (`i16x8`), so the same code lowers to **wasm `simd128`, x86
SSE/AVX, and ARM NEON** — desktop and browser both benefit.
The encode path is unchanged.
## How it stays bit-exact (no `unsafe`, no `cfg` split)
The lifting steps need i32 intermediates only for the averages.
Overflow-free SWAR identities let the whole kernel stay in `i16` lanes
(no widen/narrow):
- `ceil_avg(a,b) = (a|b) - ((a^b)>>1)` ≡ `(a + b + 1) >> 1`
- `floor_avg(a,b) = (a&b) + ((a^b)>>1)` ≡ `(a + b) >> 1`
and `(2x+1)>>1 == x` / `(x+x)>>1 == x` simplify the first/last rows.
Every other op is wrapping `i16` arithmetic, identical to the old
`i32`-intermediate-then-`as i16` truncation.
## Performance
1080p RemoteFX replay, headless Chromium, wasm release `+simd128`,
8-pass median:
| inverse DWT | decode (ms) |
|---|--:|
| scalar (baseline) | ~1598 |
| **portable `wide` SIMD** | **~985** |
→ inverse DWT ~2×, **~39% off the decode stage**. (Absolute ms carry
~±15% machine-load noise; the ratio is stable. Per-frame this is a
throughput win — decode was already within real-time budget.)
## Correctness
Verified bit-exact three ways:
- the replay-bench **framebuffer CRC32** is unchanged,
- the existing **native DWT tests** pass (so it's exact on x86 too, not
just wasm),
- an **exhaustive** check of the SWAR identities over all `i16 × i16`
pairs (0 mismatches).
## Notes
- `wide` is a single-user dep in `ironrdp-graphics`; chosen over
`std::simd` (still nightly-only) and over per-arch intrinsics (one
portable kernel vs three).
- Reproducible bench branches: `bench/draw-*` (renderer) and the DWT
measurements were taken on the replay-bench harness branch (the capture
corpus is gitignored).
The connector types are unlikely to benefit from random value generation
for fuzzing purposes; a more targeted approach would be preferable if
the connector is fuzzed in the future. We’ll reevaluate later.
- Clean up permissions and remove unnecessary fetch-depth settings from
release workflow.
- Clean up unused peer dependency entries from package-lock.json files.