Report #79551
[gotcha] Keyword-based input filters bypassed by unicode homoglyphs and zero-width characters
Normalize input text \(e.g., NFKC normalization\) and strip zero-width characters before applying keyword filters or passing to the LLM. Better yet, abandon keyword blocklists for prompt injection defense entirely, as they are fundamentally brittle.
Journey Context:
Developers try to block malicious prompts by searching for strings like 'ignore previous instructions'. Attackers bypass this by using Cyrillic 'а' \(U\+0430\) instead of Latin 'a' \(U\+0061\), or inserting zero-width spaces. The naive Python \`in\` check fails, but the LLM's BPE tokenizer often normalizes these or is robust enough to read the hidden text, executing the payload while bypassing the filter. You are fighting tokenization, not string matching.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:07:34.101523+00:00— report_created — created