What Are Injection Attacks ?

Injection attacks refer to a broad class of attack vectors that allow an attacker to supply untrusted input to a program, which gets processed by an interpreter as part of a command or query which alters the course of execution of that program. Injection attacks are among  the oldest and most dangerous web application attacks. They can result in data theft, data loss, loss of data integrity, denial of service, as well as full system compromise.

What makes injection attacks particularly scary is that their attack surface is enormous (especially for SQLi and XSS). Furthermore, Injection attacks are a very well understood vulnerability class, meaning that there are countless freely available and reliable tools that allow even inexperienced attackers to abuse these vulnerabilities automatically.

Types of Injection Attacks

While SQL injection (SQLi) and Cross-site Scripting (XSS) are the most commonly talked about injection attacks, they are by far not the only ones.

The following is a list of common injection attacks :-

Injection attack Descriptions Potential impact
Code injection Injects application code which can execute operating system commands as the user running the web application. Advanced attacks can make use of privilege escalation vulnerabilities to gain even higher privileges if necessary, which may lead to full system compromise.
  • Full system compromise
SQL injection (SQLi)  Injects SQL commands that can read or modify data from a database. Advanced variations of this attack can be used to write arbitrary files to the server and even execute OS commands which may lead to full system compromise.
  • Authentication bypass
  • Information disclosure
  • Data loss
  • Data theft
  • Loss of data integrity
  • Denial of service
  • Full system compromise.
Cross-site Scripting (XSS) Injects arbitrary JavaScript into a legitimate website or web application which is then executed inside a victim’s browser.
  • Account impersonation
  • Defacement
  • Run arbitrary JavaScript in the victim’s browser
Email (Mail command/SMTP) injection Injects IMAP/SMTP statements to an mail server that is not directly available via a web application.
  • Spam relay
  • Information disclosure
OS Command injection Injects operating system commands as the user running the web application. Advanced variations of this attack can leverage privilege escalation vulnerabilities which may lead to full system compromise.
  • Full system compromise
LDAP injection Injects LDAP (Lightweight Directory Access Protocol) statements to execute arbitrary LDAP commands including granting permissions and modifying the contents of an LDAP tree.
  • Authentication bypass
  • Privilege escalation
  • Information disclosure
Host header injection Abuses the implicit trust of the HTTP Host Header to poison password-reset functionality and poison web caches.
  • Password-reset poisoning
  • Cache poisoning
CRLF injection Injects an unexpected CRLF (Carriage Return and Line Feed) character sequence used to split an HTTP response header and write arbitrary contents to the response body, including Cross-site Scripting (XSS).
  • Cross-site Scripting (XSS)
XPath injection Inject data into an application to execute crafted XPath queries which can be used to access unauthorized data and bypass authentication.
  • Information disclosure
  • Authentication bypass

If you enjoyed this post, I’d be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Twitter or Facebook. Thank you !

Credit: Dzone

Leave a Reply

Your email address will not be published. Required fields are marked *