You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The local-windows-rdp module interpolates var.password into two places without escaping it for the target syntax. With a password containing common special characters, the startup script fails to parse and the app URL is corrupted.
$, backtick, and " are interpreted inside a PowerShell double-quoted string. Observed on a live AWS Windows workspace with password = "Te\st$Pa\"ss'word&<>|1!", the whole Configure RDP` script aborts before it does anything:
The string is missing the terminator: '.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
The workspace then reports start_error and the admin password is never set.
The password truncates at the first &, so Coder Desktop receives Te\st$Pa"ss'word. A #would drop everything after it,+decodes as a space, and a bare%` is an invalid escape.
Expected Behavior
The password set on the Windows account and the password handed to Coder Desktop are both byte-identical to var.password, for any character.
Steps to Reproduce
Use the local-windows-rdp module on a Windows workspace with password = "Te\st$Pa\"ss'word&<>|1!"`.
Start the workspace.
The Configure RDP script fails with the parser error above, and the Open RDP app URL is truncated at the &.
Desired Solution
Encode each value for its destination, the same approach used for windows-rdp in #1034:
Destination
Encoding
PowerShell script
single-quoted string with ' doubled
App URL query
urlencode() on both username and password
A test asserting the rendered script and app URL round-trip a password containing \ " ' `` `` $ & < > | # % +` would keep this from regressing.
Note
Third module with this bug class, after #20 (windows-rdp) and #1035 (amazon-dcv-windows). Found while dogfooding the fix in #1034 on a real AWS Windows workspace.
Current Behavior
The
local-windows-rdpmodule interpolatesvar.passwordinto two places without escaping it for the target syntax. With a password containing common special characters, the startup script fails to parse and the app URL is corrupted.1. PowerShell double-quoted string —
configure-rdp.ps1:97$, backtick, and"are interpreted inside a PowerShell double-quoted string. Observed on a live AWS Windows workspace withpassword = "Te\st$Pa\"ss'word&<>|1!", the wholeConfigure RDP` script aborts before it does anything:The workspace then reports
start_errorand the admin password is never set.2. Unencoded URL query parameter —
main.tf:75The credentials go straight into the query string with no
urlencode. The rendered app URL on the same workspace was:The password truncates at the first
&, so Coder Desktop receivesTe\st$Pa"ss'word. A#would drop everything after it,+decodes as a space, and a bare%` is an invalid escape.Expected Behavior
The password set on the Windows account and the password handed to Coder Desktop are both byte-identical to
var.password, for any character.Steps to Reproduce
local-windows-rdpmodule on a Windows workspace withpassword = "Te\st$Pa\"ss'word&<>|1!"`.Configure RDPscript fails with the parser error above, and theOpen RDPapp URL is truncated at the&.Desired Solution
Encode each value for its destination, the same approach used for
windows-rdpin #1034:'doubledurlencode()on both username and passwordA test asserting the rendered script and app URL round-trip a password containing
\ " ' ```` $ & < > | # % +` would keep this from regressing.Note
Third module with this bug class, after #20 (
windows-rdp) and #1035 (amazon-dcv-windows). Found while dogfooding the fix in #1034 on a real AWS Windows workspace.Related to #20, #1035
Follow-up for #1034