Bypassing WAFs with Unicode Compatibility
Modern WAFs are tough, but Unicode normalization can be their undoing. Learn how to use compatibility characters to sneak payloads past security filters.
Bypassing WAFs with Unicode Compatibility#
Web Application Firewalls (WAFs) often rely on blacklists. They block <script>, javascript:, and alert(. But what if we can write these words without using standard ASCII characters?
The Magic of Unicode Normalization#
Many systems normalize input before processing it. This means they convert "fancy" characters into their standard ASCII equivalents.
<(Fullwidth Less-Than) becomes<script(Fullwidth Latin) becomesscript℡(Telephone Sign) might becomeTEL
The Attack#
If the WAF checks the input before normalization, but the backend application processes it after normalization, we have a bypass.
Example: XSS#
WAF Rule: Block <script>
Payload: <script>alert(1)</script>
Flow:
- WAF: Sees
<script>. This does not match<script>. PASS. - Backend: Normalizes input.
<script>becomes<script>. - Execution: The browser executes the script.
Finding Compatible Characters#
You can use the IDNA (Internationalizing Domain Names in Applications) standard to find these mappings.
Ican be represented byⅠ(Roman Numeral One)Kcan be represented byK(Kelvin Sign)
Conclusion#
Unicode is vast and complex. Whenever you face a WAF, check if the application performs normalization. It might be your golden ticket.
What do you think?
React to show your appreciation