Desktop Access: Gracefully Handle Invalid Smartcard Commands#61045
Merged
rhammonds-teleport merged 1 commit intomasterfrom Nov 5, 2025
Merged
Desktop Access: Gracefully Handle Invalid Smartcard Commands#61045rhammonds-teleport merged 1 commit intomasterfrom
rhammonds-teleport merged 1 commit intomasterfrom
Conversation
zmb3
approved these changes
Nov 5, 2025
…smart card error code to the server.
5910202 to
7525720
Compare
danielashare
approved these changes
Nov 5, 2025
Contributor
|
@rhammonds-teleport See the table below for backport results.
|
This was referenced Nov 10, 2025
mmcallister
pushed a commit
that referenced
this pull request
Nov 19, 2025
…smart card error code to the server. (#61045)
mmcallister
pushed a commit
that referenced
this pull request
Nov 20, 2025
…smart card error code to the server. (#61045)
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.
This PR fixes a PDU error encountered by a customer when opening a proprietary application. Similar to issues seen with other applications that utilize hardware security keys (such as KeepassXC), opening this application appears to cause some RDPDR traffic to our virtualized smart card and reader.
In this particular case, the Windows host was sending PTS (Protocol Type Selection) messages to our virtual smart card, which is perceived as an invalid command by the iso7816 crate that we use for parsing these commands. It seems that we shouldn't be receiving these commands anyhow, as our virtual smart card explicitly advertises itself as using a specific, non-negotiable communication protocol.
The fix is to simply return a smart card error to the Windows host, rather than return with a PDU error (which is fatal to the connection). A dev build with this patch was sent to the customer who reported stable RDP connections while testing with it.
changelog: Improve error handling during desktop sessions that encounter unknown/invalid smartcard commands. This prevents abrupt desktop session termination with a "PDU error" message when using certain applications.