PowerShell Password Variable converted into HTML Code

Implemented

PowerShell Password Variable converted into HTML Code

avatar

Hi,

I'm using the latest version of RDM and am having an issue using the $PASSWORD$ varibale inside a powershell item.
Credentials are being passed from Secret Server via the "Linked (Vault)" credential.

When I insert the $PASSWORD$ variable into a Powershell script, the "greater than", "less than" and "Ampersand" are converted into HTML code > and < and & (And it appears this is the case for other HTML symbols as well)

If the hyperthetical password is "test<>&", the value returned is "test&lt>&"

Is this a bug in RDM, or is there a way to get RDM not to convert the password into HTML code?

forum image

All Comments (7)

avatar

Hello,

Do you use the latest release 2022.1.27 or the latest beta 2022.2.11?

I cannot reproduce this behaviour within RDM 2022.1.27.

What entry type are you using to run the PowerShell script?

The following script is embedded in a PowerShell Macro/Script/Tool entry type.

forum image

When running it against a session entry like an RDP entry, it works properly.

forum image

Best regards,

Érica Poirier

avatar

Hi,

I'm using 2022.1.27
forum image

I'm using the PowerShell session entry
forum image

Credentails are being pulled from Secret Server
forum image

And have embedded the script
forum image

And the script looks something like this

$secStringPassword = ConvertTo-SecureString ($PASSWORD$) -AsPlainText -Force
$Credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username, $secStringPassword

If I the run the command $Credentials.GetNetworkCredential().Password a lot of hte special characters have been escaped into HTML code.
This is also true if I simply create a variable using $PASSWORD$, so it's nothing to do with creating PowerShell credentials

Here is a test script I have written
forum image

An the output from the console

forum image



avatar

And then a simplfied version of the script
forum image

And the output

forum image

avatar

Hello,

Thank you for your feedback.

I can reproduce this issue. A ticket has been submitted to our engineering department. Once an update will be available, we will post it here.

Best regards,

Érica Poirier

avatar

Thank you

avatar

Hello,

I forgot to mention that this issue occurs when the Credentials property is set to Linked (Vault). When the Credentials property is set to custom and the username/password is saved in the entry itself, it's working properly.

Best regards,

Érica Poirier

avatar

Hello,

A fix for this issue has been deployed and will be available in version 2022.2.13.0.

Regards

Jonathan Del Signore