← Back to Writeups
PORTSWIGGERN/ASQL_injection

SQL injection vulnerability in WHERE clause allowing retrieval of hidden data

XESXOR9/2/20261 min read
#sql_injection#portswigger#web-security-academy

SQL injection vulnerability in WHERE clause allowing retrieval of hidden data

Platform: PortSwigger | Category: SQL_injection | Type: Lab | Difficulty: N/A | OS: N/A | Author: XESXOR | Date: 2026-08-24 | Status: Solved Techniques: Web Security Academy, SQL_injection

Summary

Walkthrough of the PortSwigger Web Security Academy lab SQL injection vulnerability in WHERE clause allowing retrieval of hidden data (SQL_injection). This lab demonstrates a sql_injection vulnerability and its exploitation to achieve the lab objectives.

Lab Overview

PortSwigger Web Security Academy — SQL_injection

This writeup is part of the XESXOR PortSwigger collection. The original lab description and solution have been preserved and reformatted for clarity.

Lab Description :

image

Solution :

Query made -

sql
SELECT * FROM products WHERE category = 'Gifts' AND released = 1`

To view all the products (both released and not released) , we include Gifts' OR 1=1 -- so that it the condition evaluates to TRUE & displayed all the gifts.

The query looks like

sql
SELECT * FROM products WHERE category = 'Gifts' OR 1=1 --' AND released = 1`

NOTE - URL encode before forwarding the request

image

Key Takeaways / Lessons

  • Understanding SQL_injection detection and exploitation is crucial for web security.
  • Always validate and sanitize user input; implement proper access controls.
  • This lab is part of the PortSwigger Web Security Academy — practice in a safe, legal environment.

Crafted by XESXOR Research • 2026-08-24 • PortSwigger Web Security Academy • Lab: SQL injection vulnerability in WHERE clause allowing retrieval of hidden data