Command injection is a kind of cyber attack that allows an attacker to execute arbitrary commands on a system. Attackers accomplish this by exploiting vulnerabilities in an application’s input validation process. How Command Injection Works Command injection attacks occur when an application passes unsafe user input to a system shell. In these instances, attackers can manipulate the input data to include additional commands, granting them unauthorized access to the underlying system.