Overview
Direct Answer
SQL injection is a code injection vulnerability that allows attackers to insert malicious SQL statements into input fields of database-driven applications, bypassing authentication or extracting unauthorised data. This occurs when user-supplied input is concatenated directly into SQL queries without proper sanitisation or parameterised preparation.
How It Works
Attackers craft specially formatted input strings containing SQL syntax that, when concatenated into a query, alter the intended logic. For example, entering a username field with ' OR '1'='1 changes a WHERE clause to always evaluate as true, circumventing login checks. The vulnerability exists because the application fails to distinguish between data and executable SQL commands.
Why It Matters
Organisations face significant financial and reputational damage from unauthorised database access, data breaches, and regulatory fines under standards such as GDPR and PCI DSS. Attackers exploit this technique to steal customer records, manipulate transactions, or disable critical systems with minimal technical effort.
Common Applications
This vulnerability affects web applications with login forms, search functionality, and content management systems. Financial services, healthcare platforms, and e-commerce systems remain frequent targets due to the sensitivity of stored information.
Key Considerations
Parameterised queries and prepared statements provide robust mitigation, though defence-in-depth strategies including input validation and least-privilege database accounts remain essential. Legacy applications and rapid development practices increase exposure risk.
More in Cybersecurity
Cyber Insurance
Security GovernanceInsurance coverage protecting organisations against financial losses from cyberattacks, data breaches, and related incidents.
AI-Powered Threat Detection
Offensive SecuritySecurity systems that leverage machine learning and behavioural analytics to identify sophisticated cyber threats, anomalous patterns, and zero-day attacks in real time.
Software Bill of Materials
Offensive SecurityA comprehensive inventory of all software components, libraries, and dependencies used in an application, enabling vulnerability tracking and supply chain risk management.
Deception Technology
Identity & AccessSecurity solutions that deploy decoy assets such as fake servers, credentials, and data to detect, misdirect, and analyse attackers who have breached perimeter defences.
Attack Surface Management
Offensive SecurityThe continuous discovery, inventory, classification, and monitoring of all external-facing digital assets to identify and reduce an organisation's exposure to cyber threats.
Information Security
Security GovernanceThe practice of protecting information by mitigating information risks including unauthorised access, use, and disruption.
MITRE ATT&CK
Offensive SecurityA globally accessible knowledge base of adversary tactics and techniques based on real-world cyber observations.
Supply Chain Attack
Offensive SecurityA cyberattack targeting the less-secure elements of a supply chain to compromise a primary target.