Operating system command injection (timing attack)

High Web Application Scanning Plugin ID 98124


Operating system command injection (timing attack)


To perform specific actions from within a web application, it is occasionally required to run Operating System commands and have the output of these commands captured by the web application and returned to the client.
OS command injection occurs when user supplied input is inserted into one of these commands without proper sanitisation and is then executed by the server.
Cyber-criminals will abuse this weakness to perform their own arbitrary commands on the server. This can include everything from simple `ping` commands to map the internal network, to obtaining full control of the server.
By injecting OS commands that take a specific amount of time to execute, scanner was able to detect time based OS command injection. This indicates that proper input sanitisation is not occurring.


It is recommended that untrusted data is never used to form a command to be executed by the OS.
To validate data, the application should ensure that the supplied value contains only the characters that are required to perform the required action.
For example, where the form field expects an IP address, only numbers and periods should be accepted. Additionally, all control operators (`&`, `&&`, `|`, `||`, `$`, `\`, `#`) should be explicitly denied and never accepted as valid input by the server.

See Also


Plugin Details

Severity: High

ID: 98124

File Name: was_os_cmd_injection_timing.nasl

Type: remote

Published: 2017/03/31

Modified: 2017/10/16

Risk Information

Risk Factor: High

Reference Information

CWE: 78

WASC: OS Commanding

OWASP: 2017-A1, 2013-A1