← Lab /Security & privacy

Unicode overflow lets attackers bypass character blocklists

Unicode codepoint truncation can be used to bypass character blocklists and inject arbitrary ASCII characters.

Security & privacy PortSwigger Research 28 Jan 2025 Attack Real-world evidence

Published as “Bypassing character blocklists with unicode overflows”

Why it matters

Blocklist filters that rely on raw Unicode codepoints can be evaded, so defenders must normalize or truncate inputs before applying character restrictions.

Summary

The writeup explains that when a server stores a Unicode character in a single byte, the value wraps around (mod 256) and can be crafted to produce a chosen ASCII character. The authors demonstrate this with specific codepoints that, after modulo 256, yield the letter "A" and with JavaScript's fromCharCode overflow producing "1337". They note that bug bounty hunters are already exploiting this technique, and they have added detection rules to ActiveScan++ and a Hackvertor tag to reproduce the characters. The evidence consists of code snippets and a claim of real-world usage, but no systematic measurement is provided.

What they found 2

  1. Unicode codepoint truncation can be crafted to produce specific ASCII characters

    “Unicode codepoint truncation - also called a Unicode overflow attack - happens when a server tries to store a Unicode character in a single byte.”

  2. JavaScript's fromCharCode overflows above 0xFFFF and yields attacker-controlled characters

    “String.fromCharCode(0x10000 + 0x31, 0x10000 + 0x33, 0x10000 + 0x33, 0x10000 + 0x37) //1337”

What’s new here 4

  • Identifies Unicode codepoint truncation as a bypass for character blocklists
  • Shows concrete examples using modulo 256 and JavaScript fromCharCode overflow
  • Integrates detection of these overflow characters into ActiveScan++
  • Adds a Hackvertor tag and updates the Shazzer Unicode table for reproducibility