title: Command Injection Vulnerability in Java
body: <p>I am trying to run Microsoft Rdp application from code.</p>
  
  <p>I have the following pseudo-code and <code>SonarQube</code> complains about <code>Command Injection Vulnerability</code></p>
  
  <pre><code>String rdpFilePath = myObject.getRdpFilePath() // get path of .rdp settings file 
  ProcessBuilder processBuilder = new ProcessBuilder();
  processBuilder.command("mstsc", rdpFilePath).start();
  </code></pre>
  
  <p>SonarQube Issue explanation is following:</p>
  
  <pre><code>-Potential Command Injection-
  The highlighted API is used to execute a system command. 
  If unfiltered input is passed to this API, it can lead to arbitrary command execution.
  </code></pre>
  
  <p>How can filter my input and how can i fix this security issue?</p>