GhostApproval: Symlinks Can Mislead AI Coding Assistant Approval Prompts

· Original article ↗

Summary

GhostApproval can make AI coding assistants display a benign filename while writing through a symlink to a sensitive file. The article describes vendor examples and recommends safeguards such as symlink scanning and filesystem sandboxing.

Key points

  • An attacker can place a symlink in a repository and use README instructions to prompt an AI coding assistant to write to its sensitive target, such as ~/.ssh/authorized_keys.
  • The article says approval prompts in several assistants showed an innocent or misleading path even when the write went to the symlink’s resolved destination.
  • Reported behaviors varied: Cursor wrote to the resolved target after approval, Antigravity showed a sibling or symlink path and has since been fixed, and Windsurf displayed its prompt after writing.
  • The article describes a case where an assistant silently read an AWS credentials file through a symlink and wrote SSH keys and shell payloads without prompting.
  • The author reports that most vendors had fixed the issue or planned fixes, while noting that behavior may vary by tool and interface.
  • Recommended safeguards include treating cloned repositories as untrusted, scanning for symlinks, checking resolved destinations in prompts and diffs, monitoring sensitive files, and sandboxing agents at the filesystem level.

Article Details

Topic
GhostApproval symlink attacks that misrepresent file destinations or display approval prompts after writes in AI coding assistants

Vendors

Products

Related Articles