Injection attacks refer to a broad class of attack vectors. In an injection attack, an attacker supplies untrusted input to a program. This input gets processed by an interpreter as part of a command or query. In turn, this alters the execution of that program.
Injections are amongst the oldest and most dangerous attacks aimed at web applications. They can lead to data theft, data loss, loss of data integrity, denial of service, as well as full system compromise. The primary reason for injection vulnerabilities is usually insufficient user input validation.
This attack type is considered a major problem in web security. It is listed as the number one web application security risk in the OWASP Top 10 – and for a good reason. Injection attacks, particularly SQL Injections (SQLi attacks) and Cross-site Scripting (XSS), are not only very dangerous but also widespread, especially in legacy applications.
What makes injection vulnerabilities particularly scary is that the attack surface is enormous (especially for XSS and SQL Injection vulnerabilities). Furthermore, injection attacks are a very well understood vulnerability class. This means that there are many freely available and reliable tools that allow even inexperienced attackers to abuse these vulnerabilities automatically.
Types of Injection Attacks
SQL injection (SQLi) and Cross-site Scripting (XSS) are the most common injection attacks but they are not the only ones. The following is a list of common injection attack types.
Injection attackDescriptionPotential impactCode injectionThe attacker injects application code written in the application language. This code may be used to execute operating system commands with the privileges of the user who is running the web application. In advanced cases, the attacker may exploit additional privilege escalation vulnerabilities, which may lead to full web server compromise.Full system compromiseCRLF injectionThe attacker injects an unexpected CRLF (Carriage Return and Line Feed) character sequence. This sequence is used to split an HTTP response header and write arbitrary contents to the response body. This attack may be combined with Cross-site Scripting (XSS).Cross-site Scripting (XSS)Cross-site Scripting (XSS)The attacker injects an arbitrary script (usually in JavaScript) into a legitimate website or web application. This script is then executed inside the victim’s browser.
- Account impersonation
- Defacement
- Run arbitrary JavaScript in the victim’s browser
- Spam relay
- Information disclosure
- Password-reset poisoning
- Cache poisoning
- Authentication bypass
- Privilege escalation
- Information disclosure
- Authentication bypass
- Information disclosure
- Data loss
- Sensitive data theft
- Loss of data integrity
- Denial of service
- Full system compromise.
- Information disclosure
- Authentication bypass
It’s easy to test if your website or web application is vulnerable to all the injection attacks listed above. All you need to do is run an automated web scan using the Acunetix vulnerability scanner. Take a demo and find out more about running scans against your website or web application.
Frequently asked questions
What are injection attacks?
In an injection attack, the attacker is able to provide malicious input to a web application (inject it). The application processes this malicious input, which causes the application to behave in an unexpected way. For example, it may reveal information that should not be revealed, give the user permissions that the user should never have, or run harmful code on the server or on the client.
Learn more about the basics of web security.
What are the common types of injection attacks?
Some of the most common types of injection attacks are SQL injections, cross-site scripting (XSS), code injection, OS command injection, host header injection, and more. A large part of vulnerabilities that exist in web applications can be classified as injection vulnerabilities.
Read about SQL injection – one of the most serious types of injection attacks.
How to detect injection vulnerabilities?
The most efficient way to detect injection vulnerabilities, which make injection attacks possible, is by using an automated web vulnerability scanner. You can detect them manually through penetration testing but this takes a lot more time and resources. Acunetix is able to detect, assess, and manage all types of injection vulnerabilities.
See what Acunetix Premium can do for you.
How to avoid injection attacks?
To avoid injection attacks you must code your web applications in a secure way to avoid injection vulnerabilities. The most important part is: never trust user input. The more you restrict, control, and monitor any form of user input, the more you can avoid your application being hacked.
Learn more about secure coding best practices.
Get the latest content on web security
in your inbox each week.
We respect your privacy
SHARE THIS POST
THE AUTHOR
Ian Muscat