Exploiting LLM Vulnerabilities: How Invisible Unicode Characters Can Turn Rule Files into Malware

Listen to this Post

A new vulnerability in Cursor, an AI-powered coding assistant, demonstrates how third-party rule files can be weaponized using invisible Unicode characters. Attackers can inject malicious commands undetectable to humans but parsed by the LLM, leading to arbitrary code execution.

How the Attack Works

  1. Rule File Manipulation: Attackers insert invisible Unicode characters (e.g., zero-width spaces) into rule files meant to guide AI-generated code.
  2. LLM Parsing: The LLM processes these hidden commands, treating them as executable instructions.
  3. Malicious Code Execution: The manipulated rule file forces the LLM to generate attacker-controlled code, such as injecting a `