▌▌ WEBSEC://CONSOLE

Track 02

🗄️ SQL Injection

On WordPress this almost never lives in core — it lives in plugins and themes that build SQL strings by hand. Flip the breaker to swap a raw concatenated query for a parameterized $wpdb->prepare() call.

Search query builder
RAW CONCATPREPARE()
MODE
// User input: ' OR '1'='1
$sql = "SELECT * FROM wp_users WHERE user_login = '$username'";
$wpdb->get_results($sql);

-- resulting query --
SELECT * FROM wp_users WHERE user_login = '' OR '1'='1'

Safe query checklist