Advisory VV-011high2025-03
“Rules File Backdoor”: hidden Unicode instructions in AI rules files
Pillar Security showed invisible Unicode characters in shared rules files (.cursorrules, .mdc) can steer Cursor and GitHub Copilot into writing backdoored code.
What it is
Attackers encode instructions with zero-width joiners and bidirectional markers. They are invisible to humans, including in GitHub pull request review, but parsed by the AI.
How to check
- Scan .md / .mdc / rules files for invisible Unicode (command below, or Pillar’s free Rule File Scanner).
How to fix
- Treat AI rules/config files like code: review them, and block hidden Unicode in CI.
# Find zero-width and bidi control characters in rules files
grep -rnP "[\x{200B}-\x{200F}\x{202A}-\x{202E}\x{2066}-\x{2069}\x{FEFF}]" \
.cursorrules .cursor/ --include=*.md --include=*.mdc