Any session that reactivates (Deactivate All → re-activate) loses bulk
decompression and dies right after. Windows consoles reactivate right
after logon, and compression is on by default, so this hits pretty
easily.
The reactivation path rebuilt the FastPath processor with
[`bulk_decompressor:
None`](https://github.com/Devolutions/IronRDP/blob/079b4842/crates/ironrdp-client/src/rdp.rs#L988).
After that every compressed update got parsed as a raw bitmap:
```
Received compressed FastPath data but no decompressor is configured
BitmapData decode NotEnoughBytes: received 1662, expected 17134
```
Fix: `ActiveStage` keeps the negotiated compression type and gets a
`reactivate(...)` that rebuilds the processor *with* a fresh
decompressor. Native client, web, FFI and the e2e test all go through it
now instead of hand-building a processor. The FFI one was the same bug —
worth noting since RDM hits that path.
All additive, no API break (`compression_type` was already on
`ActiveStageBuilder`).
### Testing
Hyper-V console on my lab box, default config (K64), before/after —
first frame then dead vs. a session that keeps rendering. Compression
ratio was ~24x on the initial paint, so this isn't a rare edge.
Also ran a normal RDP session to a Windows Server VM to be sure nothing
regressed.
`cargo check`/`clippy` clean (session, client, web wasm32, ffi), fmt
clean, testsuite-core 949 + testsuite-extra 21 green.
---------
Co-authored-by: Marc-André Moreau <mamoreau@devolutions.net>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
## Summary
The `ironrdp-agent` Windows named-pipe listener inherited the pipe
namespace's default ACL, so **any local user** could connect to a
running daemon and drive the session — inject input, capture
screenshots, read logs, and trigger NOW remote execution. The Unix
listener already locks its socket to `0o600` (owner-only); this mirrors
that stance on Windows.
## The fix
Build a **protected DACL** (`D:P(A;;GA;;;{user-sid})`) granting
`GENERIC_ALL` only to the current user's SID, and apply it to **every**
`CreateNamedPipeW` instance (both the first in `bind` and the
replacement minted in `accept`) via tokio's
`create_with_security_attributes_raw`. The descriptor is cached on the
`Listener` and reused across instances (the kernel copies it on each
`CreateNamedPipeW`, so it only needs to outlive each synchronous call).
Implementation follows the established windows-FFI style used by sibling
crates (`ironrdp-cliprdr-native`): the `windows` crate (0.62, matching
siblings), RAII guards (`OwnedTokenHandle`, `OwnedSecurityDescriptor`)
for `CloseHandle`/`LocalFree` cleanup, one unsafe op per block with `//
SAFETY:` comments, `.cast::<>()` + `try_from` instead of `as` casts, and
`tracing::warn!` on cleanup failure.
## Why this matters
On shared Windows hosts the `\\.\pipe\` namespace is reachable by every
local user by default. This is the last line of defense against a
different local user taking over a running agent session. It closes the
asymmetry with the Unix path, which already documents the `/tmp`
fallback as world-writable and explicitly sets `0o600`.
## Test coverage
`transport.rs` previously had **zero tests**. Added a Windows-gated
`#[cfg(test)]` smoke test
(`security_descriptor_for_current_user_is_non_null`) that exercises the
full token → SID → SDDL → security-descriptor pipeline for the current
process and asserts a non-null descriptor is produced — the happy path
`Listener::bind` depends on. (Asserting the ACL denies a *different*
user requires a second token context and is out of scope.)
## Verification
All `cargo xtask` CI-equivalent checks pass on a clean tree:
- `cargo xtask check fmt -v` → All good
- `cargo xtask check lints -v` (workspace clippy `--all-targets -D
warnings`) → All good (ironrdp-agent produces zero warnings)
- `cargo test -p ironrdp-agent` → 12 passed; 0 failed (incl. the new
test)
- `cargo xtask check locks -v` → All good
## Files
- `crates/ironrdp-agent/Cargo.toml` — add `windows = "0.62"`
(cfg(windows),
Win32_Foundation/Security/Security_Authorization/System_Threading)
- `crates/ironrdp-agent/src/transport.rs` —
`OwnedTokenHandle`/`OwnedSecurityDescriptor` RAII guards,
`create_server_instance` helper, `Listener` caches + reuses the SD; new
smoke test
- `Cargo.lock` — +1 line registering `windows` as an ironrdp-agent dep
(no new versions; crates already present via siblings)
## Release
This is a `fix(agent):` conventional commit, picked up by release-plz
into the next release cycle (alongside the existing `feat(agent)`
NOW-integration commit) to propose the `0.2.0` bump once merged to
`master`. CHANGELOG is auto-generated — no manual edit needed.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
## Summary
- Integrate the released registry `now-client = "0.1.0"` into
`ironrdp-agent`; no Git, path, patch, or vendored dependency is used.
- Add a per-session `Devolutions::Now::Agent` DVC endpoint with
30-second initial readiness and 10-second reconnect deadlines.
- Add durable NOW operations, IPC streaming/retention, supported CLI
forms (`run`, `powershell`, `pwsh`, `exec process`, `exec batch`), safe
PowerShell defaults, raw output forwarding, and remote exit propagation.
- Add IPC/retention coverage and an adapter regression proving immediate
Run frames are quarantined before a following Process execution.
- Do not modify Gateway or `ironrdp-dvc-pipe-proxy`.
## Validation
- `cargo test -p ironrdp-agent`
- `cargo test -p ironrdp-testsuite-extra --test integration_tests_extra
agent`
- `cargo clippy -p ironrdp-agent --all-targets -- -D warnings`
- `cargo xtask check fmt -v`
- `cargo xtask check tests -v`
- `cargo xtask check locks -v`
`cargo xtask check lints -v` is blocked by a pre-existing `ironrdp-str`
`manual_is_multiple_of` lint under the available Rust 1.90 toolchain.
`cargo xtask check typos -v` cannot run because `typos-cli` is not
installed. Authorized-VM end-to-end validation remains pending access to
the designated RDP/NOW endpoint.
---------
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
## 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).
Removes the last ironrdp-connector coupling from ironrdp-session by
turning Deactivate-All handling into a bare signal and shifting ownership
of the Deactivation-Reactivation activation sequence back to each consumer.
It introduces a ConnectionActivationFactory (fresh sequence per reactivation)
and an ActiveStageBuilder so session construction no longer depends on
ConnectionResult.
Add a CLI-driven, daemon-backed RDP client designed for programmatic
(e.g. LLM) consumption. A single binary plays two roles: a long-lived
daemon that owns the ironrdp-client engine and one RDP session, and a
short-lived CLI that drives it over a local IPC transport (Unix domain
socket / Windows named pipe).
Highlights:
- Binary, length-delimited IPC protocol using ironrdp-core's
Encode/Decode traits (no JSON). Connection config travels as a
binary-encoded PropertySet inside a strictly-typed Request::Connect;
runtime input/query operations are strictly-typed messages.
- Secrets never reach the IPC reader: ConfigBuilder::build strips every
ironrdp_cfg::is_secret_key property, and the daemon seeds its live bag
from the post-build config, so dumps/status/logs cannot leak them.
- Operator overlay: daemon-start --overlay FILE preloads a .rdp file
applied on top of every connect (overlay wins) to provision any
setting out of band, credentials in particular. Status reports
credentials_loaded so a caller knows whether it must supply a password.
- Separate logging: the daemon's own logs go to stderr (default INFO,
IRONRDP_LOG), while each RDP session's logs are captured into a small
queryable ring buffer (default DEBUG) via a thread-local subscriber,
refinable per-connect with --log-directive for troubleshooting.
- --help-agent prints a structured, LLM-friendly operation guide.
The debug! logging in insert/remove/get stringified raw keys and values
on every access, which exposed secrets such as ClearTextPassword,
gateway_password and rdcleanpath_token in logs. Observed debugging value
was low, so the logging is removed entirely rather than redacted, and
the tracing dependency is dropped.
Make ironrdp-client configurable almost entirely from a .rdp PropertySet
so that a single ConfigBuilder::from_property_set overlay can build a
working client, enabling fully reproducible sessions from .rdp files.
Viewer-only settings remain in PartialConfig with special treatment.
- cfg: add ironrdp_ vendor properties for compressionlevel, colordepth,
dvcplugin, tls, serverpointer and autologon.
- client: read compression level, color depth, DVC plugins and kerberos
from the PropertySet; default bulk compression to K64 unless disabled or
specified otherwise.
- client: move anti-idle "fake events" into active_session; consumed via
fake_events_interval, dropping it from the viewer GUI
- viewer: upsert CLI flags into the PropertySet; prune PartialConfig to
CLI-only fields
ironrdp (meta crate):
- Added: client, client-all, client-sound, client-clipboard,
client-rdpdr, client-smartcard, client-gateway,
client-dvc-pipe-proxy, client-dvc-com-plugin, and
top-level rustls / native-tls (forwarded to ironrdp-client)
- Modified: qoi, qoiz now also gate ironrdp-client's codec
ironrdp-client:
- Added: sound, clipboard, rdpdr, smartcard, gateway,
dvc-pipe-proxy, dvc-com-plugin, all; optional
subsystem crates are pulled in only via these features
- Modified: default no longer forces rustls; rustls / native-tls
stay mutually exclusive (exactly one required), and
qoi / qoiz now point at ironrdp-connector / ironrdp-session
ironrdp-viewer:
- Removed: direct ironrdp-client / backend-crate dependencies and
qoi / qoiz features
- Modified: rustls / native-tls now forward to ironrdp instead of
ironrdp-client; pulls client + client-all from the meta crate
## Summary
The web client presented frames through `softbuffer`, whose web backend
repacks
the **whole surface** (RGBA → u32 → RGBA into a fresh buffer) on every
present.
This replaces it with a direct `put_image_data` that uploads only the
dirty
region, and drops the `softbuffer` dependency.
Same idea as the IronVNC change.
## What changed
- Remove the `softbuffer` dependency; present each dirty region with
`put_image_data` at its origin.
- No full-surface buffer and no per-region scratch.
`extract_partial_image` fills
a single `WriteBuf` reused across frames, so steady-state draws don't
allocate.
- Force opaque alpha before upload (kept — see Correctness).
- Add `WriteBuf::filled_mut` to `ironrdp-core` (mutable counterpart of
`filled`).
- `web-sys`: add `CanvasRenderingContext2d` + `ImageData`, drop the
softbuffer-only
features.
## Performance
Draw-stage time on a 1080p replay (595 frames / 110 dirty regions),
headless
Chromium, 8 measured passes × 3 runs, median. Both rows are reproducible
branches
off the replay-bench harness; the only difference is the render path.
| Render path | draw (ms) | vs softbuffer | branch |
|---|--:|--:|---|
| softbuffer `present_with_damage` | ~1031 | — | `bench/draw-softbuffer`
|
| this PR (direct upload, reused `WriteBuf`) | ~97 | **~10.6×** |
`bench/draw-zerocopy` |
- The win is structural: upload the dirty region instead of repacking
the whole
surface every present.
- Reusing one `WriteBuf` (vs a per-frame allocation) keeps the
steady-state draw
allocation-free; the remaining cost is the unavoidable `ImageData` JS
copy.
- Output is **byte-identical**: framebuffer CRC32 `2d8e1b79` matches the
recorded
ground truth and the rendered-canvas FNV-1a is unchanged.
- Absolute ms carry ~±15% noise from machine load (decode drifted
1.5–1.9 s); the
ratio held across runs.
Reproduce:
```sh
git checkout bench/draw-softbuffer # or bench/draw-zerocopy
cd crates/ironrdp-web && wasm-pack build --target web --release -- --features bench
cd bench-harness && node run.mjs --capture /bench-corpus/<your>.irdprec --passes 8
```
## Correctness
`put_image_data` stores alpha verbatim, and the decoded framebuffer
isn't
guaranteed opaque — it's zero-initialised, a widened whole-rows region
can cover
not-yet-painted columns (alpha 0), and the QOI-RGBA path copies source
alpha. So
we force alpha opaque before upload. A scan-then-conditionally-force was
tried and
is *slower* than just forcing (the check touches the same bytes), so the
unconditional force stays.
## Follow-up (separate PR)
Guarantee framebuffer opacity upstream in `ironrdp-session` (init alpha
to `0xff` +
clamp `apply_rgba32`); after that the web side can drop the alpha force
entirely.
Adds an opt-in implementation of the legacy RDP NSCodec encoder as a standalone crate, and wires it into `ironrdp-server` behind a feature flag so servers can serve NSCodec-only clients (notably macOS Microsoft Remote Desktop / Windows App) without default-build behavior changes.
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.
Adds RDPDR virtual printer redirection for web sessions, enabling the web client to announce a redirected printer, receive server print jobs over RDPDR, and deliver completed PostScript jobs to a browser callback.
ironrdp-rdpfile:
- ErrorKind::InvalidValue and UnknownType now carry the property key
- ErrorKind::MalformedLine carries no data (no risk of leaking secrets)
- ErrorKind::InvalidValue carries no value (no risk of leaking secrets)
- Line numbers are 1-based in all errors
ironrdp-cfg:
- Add GatewayUsageMethod, GatewayCredentialsSource, AudioMode proper
enums with TryFrom<i64> and corresponding Unknown* error types
- Add TargetAddr / TargetHost types with full IPv6 bracketing support;
ParseTargetAddrError is a Copy enum (no allocation, no sensitive data)
- Add 15+ new PropertySetExt methods: full_address,
alternate_full_address, server_port, domain, enable_credssp_support,
compression, gateway_usage_method, gateway_credentials_source,
gateway_username, gateway_password, desktop_width/height/scale_factor,
alternate_shell, shell_working_directory, redirect_clipboard,
audio_mode, kdc_proxy_name, kdc_proxy_url
ironrdp-client:
- Two-phase config parsing: PartialConfig (phase 1, no prompts) and
into_config() (phase 2, interactive prompts + strong typing)
- Logger is set up right after PartialConfig::parse_from(), before phase
2
- New --dump-rdp <path> flag: writes merged PropertySet as .rdp file and
exits immediately (between phases, no session started)
- Map .rdp file properties to Config fields: gateway host/method/creds,
desktop dimensions, clipboard redirect, audio mode, alternate shell,
shell working dir, KDC proxy, compression, CredSSP toggle, domain
- Config.kerberos_config wired through both connect() call sites
- initial_window_size derived from config desktop dimensions
- Update README with supported .rdp properties and precedence rules