Avatar

Labs / Regex Bypass to SQLi

  • Challenge
  • Released 27 Oct 2025

🎯 One character. One flag. Can you exploit the regex?

A corporate directory validates user input with a regex pattern and Python's re.MULTILINE flag. The developers are confident their ^[a-z0-9 ]+$ pattern blocks all SQL injection attempts. They don't realize that MULTILINE changes how ^ and $ anchors behave. Security researchers know that a single control character can split validation logic across lines, bypassing even careful regex checks. Exploit this documented vulnerability and demonstrate why regex patterns cannot secure SQL queries.

1
Flags
1
Points
Challenge
Free Access
Start Lab Environment

Launch your dedicated AWS machine to begin hacking

~1-2 min setup
AWS dedicated
Private instance
Industry standard
Challenge

Web Security: Regex Bypass Leading to SQL Injection

This challenge demonstrates how flawed regex-based input validation fails to prevent SQL injection attacks. Developers often use regex patterns to block dangerous keywords, but case sensitivity and incomplete validation allow bypasses.

What You'll Learn
  • Bypassing regex-based SQLi filters
  • Case-sensitive keyword filtering flaws
  • UNION-based SQL injection techniques
  • SQLite injection exploitation
Challenge Overview

A corporate user directory implements regex filtering to prevent SQL injection. The filter blocks semicolons and backslashes, plus uppercase SQL keywords, but can be bypassed using lowercase syntax to extract the flag from the database.

Real-World Context: Regex-based SQL injection filtering is a common but flawed defense mechanism. Professional penetration testers regularly discover these vulnerabilities in applications where developers rely on basic pattern matching instead of parameterized queries.

First Blood 🩸
r3dkzyoud
Recent flags ⛳️