diff --git a/Command Injection/OSI.cs b/Command Injection/OSI.cs index 15da3434..265b3b69 100644 --- a/Command Injection/OSI.cs +++ b/Command Injection/OSI.cs @@ -13,7 +13,7 @@ public class OsInjection : ControllerBase public string os(string binFile) { Process p = new Process(); - p.StartInfo.FileName = binFile; // Noncompliant + p.StartInfo.FileName = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "allowed_binaries", Path.GetFileName(binFile))); p.StartInfo.RedirectStandardOutput = true; p.Start(); string output = p.StandardOutput.ReadToEnd();