Injection Attacks
An injection attack occurs when an attacker inserts unauthorized or malicious data into a program, query, or process in a way the application does not intend. The application then passes this data to an interpreter or execution environment, which processes it as a command rather than plain data. This can allow attackers to execute unintended commands, access unauthorized data, or compromise the affected system.
Injection attacks exploit insufficient separation between untrusted data and the commands or queries that an interpreter processes. When an application fails to correctly validate, sanitize, or parameterize externally supplied input, an attacker may craft input that alters the syntactic meaning of a command sent to a downstream interpreter, such as a SQL engine, OS shell, LDAP directory, or XML parser. The interpreter executes the attacker-controlled logic within the trust context of the application, potentially enabling unauthorized data access, remote command execution, or malware delivery. The attack surface includes any data channel through which untrusted input reaches an interpreter, including user-supplied form fields, HTTP headers, API parameters, and biometric or media inputs. Effective mitigations typically include parameterized queries, allowlist input validation, and least-privilege execution contexts, though the applicability of each control varies by interpreter type and deployment context.
Why it matters
Injection attacks represent one of the most persistent and consequential categories of vulnerability in application security. Because they exploit the fundamental trust that interpreters place in the commands and queries they receive, a successful injection attack typically operates within the full privilege context of the application, potentially granting an attacker unauthorized access to sensitive data, the ability to execute arbitrary commands, or a foothold for further compromise. The attack surface is broad, spanning any data channel through which untrusted input reaches an interpreter, including form fields, HTTP headers, API parameters, and less obvious inputs such as biometric or media data.
Who it's relevant to
Inside Injection Attacks
Common questions
Answers to the questions practitioners most commonly ask about Injection Attacks.