Skip to content

Desktop Access: Gracefully Handle Invalid Smartcard Commands#61045

Merged
rhammonds-teleport merged 1 commit intomasterfrom
rhammonds/fix/smartcard-error
Nov 5, 2025
Merged

Desktop Access: Gracefully Handle Invalid Smartcard Commands#61045
rhammonds-teleport merged 1 commit intomasterfrom
rhammonds/fix/smartcard-error

Conversation

@rhammonds-teleport
Copy link
Copy Markdown
Contributor

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.

@rhammonds-teleport rhammonds-teleport force-pushed the rhammonds/fix/smartcard-error branch from 5910202 to 7525720 Compare November 5, 2025 16:00
@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from probakowski November 5, 2025 16:05
@rhammonds-teleport rhammonds-teleport added this pull request to the merge queue Nov 5, 2025
Merged via the queue into master with commit da3118d Nov 5, 2025
41 checks passed
@rhammonds-teleport rhammonds-teleport deleted the rhammonds/fix/smartcard-error branch November 5, 2025 18:23
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@rhammonds-teleport See the table below for backport results.

Branch Result
branch/v17 Create PR
branch/v18 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants