Skip to content

In-depth lesson · Command injection

Root causes

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 17 of 17
  1. User input was passed to git without a separator, so a leading double dash was treated as a command-line option.

    Seen in 3 reports
  2. User input was inserted into a shell command string without escaping.

    Seen in 3 reports
  3. Values were inserted into generated configuration files without validation, allowing new directives.

    Seen in 3 reports
  4. User input was concatenated into a command line without a separator, so it was read as options.

    Seen in 2 reports
  5. A configuration value was interpolated into a query string and later evaluated as code.

    Seen in 2 reports
  6. Connection configuration fields were passed into command line options without validation.

    Seen in 2 reports
  7. Channel names were not validated before being sent to clients, so newline characters broke out into command context.

    Seen in 1 report
  8. The code escaped shell special characters but not spaces, so extra arguments could be injected into the image tool command.

    Seen in 1 report
  9. A username was interpolated into a backtick shell command without escaping.

    Seen in 1 report
  10. The mail library invoked a shell with a string and its quoting missed a backslash followed by a control character.

    Seen in 1 report
  11. The client called system utilities by name only, so the PATH variable decided which binary ran.

    Seen in 1 report
  12. The package name was concatenated into a shell command and authorisation was checked only after the vulnerable code ran.

    Seen in 1 report
  13. Environment variables that alter tool configuration were not restricted for lower-privileged users.

    Seen in 1 report
  14. Untrusted filter input was passed to a library that compiles strings into functions.

    Seen in 1 report
  15. Escaping logic did not account for how Windows strips trailing whitespace and periods from batch file names.

    Seen in 1 report
  16. Parameter values were escaped but environment variable names were not.

    Seen in 1 report