Repository navigation
Decoder hardening (phase 0) and the AppContainer spike (phase 1) - #72
Merged
Merged
Conversation
…sole (T9.1, T9.2)
Video from a device is checked before the decoder sees it: a picture size outside the protocol's limits, a message shorter than its header or one without data is a bad frame (logged, key frame requested) instead of ending the session; the decoder's output is converted only when a row fits its stride. Clipboard images from a device (DeviceImage): PNG, BMP and JPEG only, each with its own WIC decoder; the size read from the header first (at most 8192 x 8192) and checked against the decoded frame; colour profiles ignored. The pushed image and both formats of an offered one are rebuilt from the pixels, so the device's bytes (BMP included) never reach the clipboard. decoder-isolation-design.md: the decisions made, the phases, and the spike: framework-dependent .NET, Media Foundation H.264 and WIC run in an AppContainer with no capabilities, a job and a handle list; no measurable cost per frame; network, profile, clipboard, processes and other windows are blocked.
|
Pull requests start as drafts here. Mark this one Ready for review when it's done and all checks have passed. |
…op flow tests - Five_thousand_connections_stay_fast takes the faster of two opens: the first open once stalled for 10 s on a runner while every save around it took its usual time. - AgentDesktopFlowTests.WaitFor waits up to 30 s instead of 15 s; a wait still ends as soon as its condition holds. - The dropped-connection sign-out test waits for the session's record to be forgotten (it goes right after the cover, as in the refused sign-out test) and holds 1.5 s instead of 400 ms, well past its 150 ms look.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Phases 0 and 1 of
docs/decoder-isolation-design.md(threats T9.1 and T9.2): a device that has been compromised sends crafted video or clipboard images to the native decoders in RemoteHub's process. Phase 0 narrows what reaches those decoders now. Phase 1 checked that the full fix, a sandboxed decoder process, works before building it. The design doc (written 2026-10-22) is part of this PR, with the decisions, the phases and the spike results.Phase 0 – hardening in RemoteHub's process
Video (
AgentDesktopSession.CheckVideo,VideoCodec.cs)w × h × 4overflowsintand the buffer would be too smallClipboard images (
Services/DeviceImage.cs, used byFinishReceivingandClipboardOffer.Render)Phase 1 – spike: the decoder in an AppContainer
A throwaway program (not in the repository) ran on Windows Server 2025 the way §3.2 describes:
KILL_ON_JOB_CLOSE, one process, 1 GB and all UI limitsResult: it works as designed. No change to the design, and no C++ decoder is needed. Details are in §11.
Decisions (§9):
Tests
DeviceImageTests:ClipboardOfferTests:Docs
decoder-isolation-design.md:security-test-lab-design.md: rows T9.1 and T9.2.