All vulnerabilities
HIGHAI/LLM

AI-RULES-FILE-BACKDOOR-2025

Cursor · GitHub Copilot / Cursor rules files

Summary

Pillar Security disclosed a supply-chain attack technique called 'Rules File Backdoor' that weaponizes the configuration/rules files used to steer AI coding agents in Cursor and GitHub Copilot. Attackers embed instructions using invisible Unicode characters (zero-width joiners, bidirectional markers), contextual manipulation, and log-suppression directives that are readable by the AI but invisible to human reviewers, causing the agent to silently generate backdoored or vulnerable code and leak secrets. Because rules files are shared and reused across projects and survive forking, one poisoned file persistently compromises all future code-generation sessions for downstream users.

How to avoid it in your code

  • Vet and pin rules/config files; review them as security-sensitive code, not trusted config.
  • Scan rules files for invisible Unicode (zero-width, bidi markers) before adoption.
  • Never import rules files from untrusted forks or third-party repos without inspection.
  • Require mandatory human review plus security scanning of all AI-generated code.
  • Treat rules-file changes in PRs as privileged and require explicit approval.

References

Related vulnerabilities

All AI/LLM →