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.
-
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
-
User input was inserted into a shell command string without escaping.
Seen in 3 reports
-
Values were inserted into generated configuration files without validation, allowing new directives.
Seen in 3 reports
-
User input was concatenated into a command line without a separator, so it was read as options.
-
Configuration values were embedded in scripts users are told to run without escaping.
Seen in 2 reports
-
A configuration value was interpolated into a query string and later evaluated as code.
-
Connection configuration fields were passed into command line options without validation.
-
Channel names were not validated before being sent to clients, so newline characters broke out into command context.
Seen in 1 report
-
The code escaped shell special characters but not spaces, so extra arguments could be injected into the image tool command.
Seen in 1 report
-
A username was interpolated into a backtick shell command without escaping.
Seen in 1 report
-
The mail library invoked a shell with a string and its quoting missed a backslash followed by a control character.
Seen in 1 report
-
The client called system utilities by name only, so the PATH variable decided which binary ran.
Seen in 1 report
-
The package name was concatenated into a shell command and authorisation was checked only after the vulnerable code ran.
Seen in 1 report
-
Environment variables that alter tool configuration were not restricted for lower-privileged users.
-
Untrusted filter input was passed to a library that compiles strings into functions.
Seen in 1 report
-
Escaping logic did not account for how Windows strips trailing whitespace and periods from batch file names.
-
Parameter values were escaped but environment variable names were not.