← All advisories

VV-011highSupply chain2025-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.

01.

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.

02.

How to check

  1. Scan .md / .mdc / rules files for invisible Unicode (command below, or Pillar’s free Rule File Scanner).
03.

How to fix

  1. 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
04.

Sources

More advisories for this tool
The weekly email

One email a week. Only what changed.

Every new security hole in AI coding tools, MCP servers, app builders and the stacks they generate (Next.js, Supabase, Node, PHP), each with how to check your app and the fix. No roundups of things you already read.

Free, one email a week. Read the latest issue first if you like. One-click unsubscribe in every email. We never sell or share addresses.