Authorization disclaimer. This walkthrough is limited to the intentionally vulnerable PortSwigger Web Security Academy lab linked below. Test only systems you own or are explicitly authorized to assess.
Overview
The vulnerable product filter places category into an Oracle query. A two-column UNION first enumerates all_tables, then uses user_tab_cols to discover the randomized credential columns before selecting the administrator row from USERS_GSEMNG.
Lab objective/setup
The injection point is GET /filter?category=<value> on an Oracle back end. The objective is to identify the unknown users table and its columns, retrieve the synthetic administrator credential, and authenticate in the Academy lab.
What I observed
The response could render two text values from a UNION SELECT. Oracle does not expose information_schema; its data dictionary supplied the required metadata. Querying all_tables revealed USERS_GSEMNG, and user_tab_cols returned USERNAME_RKTXFE and PASSWORD_YCJIMQ.



Why it is vulnerable
The application concatenates the category value into SQL, allowing the original query to be extended with attacker-selected rows. The database account can also read Oracle catalog views and the credential table, so the injection crosses both a query-boundary failure and an excessive-privilege boundary.
Walkthrough in the authorized PortSwigger lab
- Confirm the response accepts two text columns with an Oracle-compatible
UNION SELECTusingdualwhere a table is required. - Request
a' UNION SELECT owner, table_name FROM all_tables -- -and inspect the rendered rows for the randomized users table,USERS_GSEMNG. - Request
a' UNION SELECT column_name,'aa' FROM user_tab_cols WHERE table_name = 'USERS_GSEMNG' -- -to recoverUSERNAME_RKTXFEandPASSWORD_YCJIMQ. - Select those fields from the discovered table with
a' UNION SELECT USERNAME_RKTXFE, PASSWORD_YCJIMQ FROM USERS_GSEMNG -- -. - Use the returned synthetic administrator credential on the lab login page.



Verification
The result is supported by a linked sequence: all_tables reveals the table, user_tab_cols reveals its schema, the final UNION returns credential rows, and the administrator value is accepted by the lab login. The solved state confirms that the catalog-derived data was correct.
Impact and defensive lesson
A UNION injection with catalog access can turn one filter parameter into broad schema discovery and credential disclosure. Parameterize the category query, grant the application account only the tables and views it needs, avoid storing reusable passwords, and monitor unexpected catalog queries from application identities.