MedallionShell icon indicating copy to clipboard operation
MedallionShell copied to clipboard

In .NET5+ projects one could use ProcessStartInfo.Arguments

Open drauch opened this issue 2 years ago • 2 comments

While I'm on it:

When targeting .NET5+ we could use ProcessStartInfo.ArgumentList to prevent argument injection by user input https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.argumentlist?view=net-5.0

Of course this would need an #ifdef for older platforms not supporting this new property.

Best regards, D.R.

drauch avatar Feb 17 '23 08:02 drauch

@drauch yeah the need for #ifdef is why I've avoided this so far but I agree that it would be nice to leverage the native capability.

MedallionShell does encode arguments to prevent injection, though. Do you have reason to believe that the built-in argument encoding is not sufficient?

madelson avatar Feb 18 '23 13:02 madelson

I haven't checked it to be honest.

drauch avatar Feb 19 '23 11:02 drauch