Skip to content

In-depth lesson · Command injection

Typical fixes

Every point the Command injection reports back under this heading, best-backed first, each with the reports it is seen in.

Back to the lesson 1 to 8 of 8
  1. Validate and escape values before inserting them into generated configuration.

    Seen in 3 reports
  2. Escape or avoid shell interpretation of user input before building commands.

    Seen in 2 reports
  3. Insert a separator before user values so they cannot be read as options.

    Seen in 1 report
  4. Restrict which configuration-altering environment variables users can set.

    Seen in 1 report
  5. Do not pass untrusted filter input to libraries that compile strings into functions.

    Seen in 1 report
  6. Account for Windows stripping trailing whitespace and periods when escaping batch file names.

    Seen in 1 report
  7. Escape environment variable names as well as values before passing them to commands.

    Seen in 1 report