
UNION-Based SQL Injection: Attack Vectors and Defense in Depth
From a penetration tester’s perspective, SQL Injection (SQLi) remains one of the most critical attack vectors against web applications. Among these, “UNION-based SQL injection”—which exploits the UNION operator—is a powerful technique that allows attackers to directly extract arbitrary information from within the database. In this article, we’ll explain how attackers subvert the specification of UNION to compromise systems, and discuss robust countermeasures against it from a design level. The Basics of UNION and Attack Prerequisites Fundamentally, the UNION operator is used to combine the results of two or more SELECT statements into a single result set. For example, it is used when you want to list both customer and employee data together. ...

