Generated by GPT-5-mini| SQL injection | |
|---|---|
| Name | SQL injection |
| Type | Injection attack |
| Discovered | 1990s |
| Affected | Relational database management systems |
SQL injection is a class of injection vulnerabilities that allow an attacker to manipulate Structured Query Language queries executed by a relational database management system through crafted input supplied to an application. It enables unauthorized data access, modification, or execution of administrative commands against back-end Microsoft SQL Server, MySQL, PostgreSQL, Oracle Database and other database engines when input handling and query construction are inadequate. Exploits of this type have influenced software development practices, regulatory guidance, and security research across technology organizations such as Microsoft, Oracle Corporation, Amazon Web Services, Google, and standards bodies including the Open Web Application Security Project.
SQL injection exploits arise when an application constructs database queries by concatenating unsanitized user-controlled data into query strings interpreted by a database interpreter such as SQLite, IBM Db2, or MariaDB. Successful exploitation can result in data exfiltration from tables used by applications from vendors like Adobe Systems, SAP SE, Salesforce, or direct modification of records in deployments at enterprises such as JPMorgan Chase, Walmart, or Equifax. Attackers may gain privileges comparable to those of the database account used by the application, enabling lateral movement into systems administered by teams at Cisco Systems or Accenture. The vulnerability class impacted compliance regimes including PCI DSS, Health Insurance Portability and Accountability Act and directives overseen by regulators like the U.S. Securities and Exchange Commission.
Early academic work and disclosure in the 1990s highlighted injection flaws as researchers at institutions such as Carnegie Mellon University and :en:Stanford University investigated database security. High-profile breaches attributed to injection techniques include incidents at Sony Pictures Entertainment, Heartland Payment Systems, TalkTalk, LinkedIn, and Yahoo! where attackers exploited weak input validation to extract customer or credential data. Nation-state and criminal groups tied to operations by threat actors reportedly impacted infrastructure managed by organizations such as National Health Service (England), U.S. Department of Veterans Affairs, and corporations like Target Corporation. Security advisories from CERT Coordination Center, NIST, and vendors such as Red Hat cataloged dozens of CVEs involving injection vectors in widely used web platforms including WordPress, Drupal, and Magento.
Attackers use techniques including tautology-based injection, union-based extraction, blind injection (boolean and time-based), stacked queries, second-order injection, and out-of-band channels. Methods often leverage differences among dialects implemented by Microsoft SQL Server, MySQL, PostgreSQL, Oracle Database, and SQLite—for example, syntax for stacked statements or metadata functions varies between Transact-SQL and PL/SQL. Tools developed by researchers and penetration testers, some from communities around Metasploit Framework and sqlmap, automate discovery and exploitation across web applications, APIs served by Amazon API Gateway or Google Cloud Platform, and middleware such as Apache Tomcat or IIS.
Applications built on stacks including LAMP (software bundle), LEMP stack, .NET Framework, Java Enterprise Edition, Ruby on Rails, and Django (web framework) have historically been affected when parameterized queries or ORM protections are not used. Vulnerable components have included stored procedures, dynamic SQL in frameworks from Oracle Corporation and SAP SE, and custom query builders in e-commerce platforms operated by merchants using Magento or Shopify integrations. Systems exposed via web servers like Apache HTTP Server and reverse proxies from NGINX may serve endpoints that accept crafted payloads enabling injection against back-end connectors such as ODBC and JDBC drivers.
Detection strategies include static analysis at development time using tools from vendors like SonarSource and Fortify, dynamic application security testing from providers such as Veracode and Burp Suite, and runtime application self-protection appliances from Imperva or F5 Networks. Logging and monitoring with platforms like Splunk, ELK Stack, or Datadog help identify anomalous query patterns, elevated query latencies, or error messages characteristic of boolean or time-based blind probes. Database-level auditing in Oracle Database, Microsoft SQL Server, and PostgreSQL can capture suspicious statements; intrusion detection systems from Snort and Suricata can detect known payload signatures at the network layer.
Primary defenses include use of parameterized queries (prepared statements) in libraries maintained by communities around PHP, Python (programming language), Java (programming language), and C#; stored procedures with strict parameterization; input validation against allow-lists; output encoding; and least-privilege database accounts provisioned through administrators trained in platforms like Red Hat Enterprise Linux or Microsoft Azure. ORMs such as Hibernate (framework), Entity Framework, and ActiveRecord provide abstractions that mitigate manual concatenation risks when used correctly. Secure development lifecycle practices advocated by OWASP and compliance frameworks enforced by ISO/IEC 27001 reduce the incidence of insecure code reaching production.
Exploitation of injection vulnerabilities intersects with laws and regulations including statutes enforced by the United States Department of Justice, directives from the European Union Agency for Cybersecurity (ENISA), and breach notification requirements in jurisdictions like California and United Kingdom. Security research that tests systems without authorization may implicate statutes such as the Computer Fraud and Abuse Act and prompt civil or criminal liability; coordinated disclosure policies promoted by organizations including FIRST and corporate vulnerability disclosure programs at Microsoft and Google aim to balance researcher ethics with responsible remediation. Ethical frameworks from academic institutions including Massachusetts Institute of Technology and professional bodies like the ACM guide acceptable testing and reporting practices.
Category:Computer security