SQL injection UNION attacks
Summary: PortSwigger Research explains that when an application is vulnerable to SQL injection and query results appear in its responses, the UNION keyword lets an attacker append additional SELECT queries and pull data from other tables. The technique requires matching the original query's column count and finding columns compatible with string data, which attackers determine by incrementing ORDER BY column indexes until an error occurs or by submitting UNION SELECT payloads with varying numbers of NULL values.
Why it matters: Once an attacker knows a table like users with username and password columns exists, a single injected input can return every credential in it - and the article notes that without that schema knowledge, the attacker only has to guess table and column names.
Read the original at PortSwigger Research ↗
- Topics
- Vulnerabilities & Patching
- Related
- Attackers Exploit UnrealIRCd Flaw That Enables Server-Level Command Injection Cyber Risks · Nov 14, 2026U.S. CISA adds Check Point and UnrealIRCd flaws to its Known Exploited Vulnerabilities catalog Cyber Risks · Nov 14, 2026PostgreSQL Patches 52 Flaws, Including 22-Year-Old Bug Enabling Authenticated RCE Cyber Risks · Nov 13, 2026