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.
Description
Trying to fix arbitrary code execution documented in #2195 by enclosing the vulnerable string with quotation marks. This should force powershell to interpret the input as string and not as code.
Motivation and Context
Should fix a security vulnerability.
How Has This Been Tested?
This code has not been tested (don't heave the development environment up and running) and I'm not sure if the double quotation is correct way of escaping the character in C#. Please verify this before merging.
Notes:
Depending on how the command is passed to the backend it might still be possible to terminate the string section with arbitrary quotation marks in the crafted string. It might be necessary to filter the input for the escaping quotation mark sequence (and thereby limiting real passwords for this use case)
Screenshots (if appropriate):
n/a
Types of changes
Checklist: