What’s a command injection?

Print anything with Printful



Command injection is a security exploit that allows malicious code to be executed on a system, often through forms on web pages or computer systems. It can give access to the back end of a system and spread viruses and malware. To prevent it, forms and inputs should be designed to limit what people can enter. The risk was first noted in the 1990s, and designers have developed workarounds, while hackers have attempted to find new ways to exploit weaknesses.

A command injection is an exploit of a system weakness to gain access to the system for the purpose of executing malicious code, harvesting user data, and engaging in other activities. While it is possible for a command injection to be benign in nature, it usually is not and can pose a significant security threat. There are a number of workarounds designed to prevent this activity in computer systems.

One of the most common points of vulnerability for a command injection is a form, either on a web page or in a computer system. Forms allow people to enter data and are then processed by the system. If there are no constraints on the type of data entered into the form, it is possible for people to enter computer code that the system will read and execute. Forms on web pages can also convert input for display to other users, exposing other people to the code as well; for example, someone could leave a malicious script in the comments on a website.

When the code runs, it can do things like give people access to the back end of a computer system, including administrative access, and it could also plant viruses and malware on a computer system. Command injections can be designed to spread, as infected computers interact with uninfected computers on a network. They can spread very quickly and can cause substantial damage down the road.

One way to avoid a command injection is to design forms and other inputs to limit what people can enter. On internet comments, for example, there would likely be no legitimate reason for users to enter script, and the comment form could simply reject the script, while still allowing HTML for markup and styling. Similarly, in a computer program, input forms might reject certain characters, preventing people from executing the code in the form.

The potential risk presented by command injection was first noted in the 1990s. A number of designers have addressed the problem and have come up with various ways to prevent or stop command injection attacks. Hackers have also attempted to develop their own workarounds, developing new and inventive ways to run code through weak spots in a computer system. Some people develop new techniques out of sheer academic interest and occasionally cause havoc by accident when their research fades into thin air, so to speak.




Protect your devices with Threat Protection by NordVPN


Skip to content