Snyk
Read post

Symlinks Are Still Scary — And Yes, Git Supports Them

Symlinks committed to Git repos can silently redirect file reads and writes to arbitrary locations on a developer's machine. When an AI coding assistant is asked to 'set up' a cloned repo, it may follow a symlink disguised as an innocent config file and write an attacker's SSH key into ~/.ssh/authorized_keys — without the user realizing the real target. Wiz Research's GhostApproval report found this flaw in all six major AI coding assistants tested (Amazon Q Developer, Claude Code, Augment, Cursor, Google Antigravity, Windsurf). The attack chains three weaknesses: prompt injection via README instructions, symlink following without path resolution, and UI misrepresentation in approval dialogs. The fix is well-known: resolve every path to its canonical location before opening it, enforce workspace boundaries atomically (e.g., Linux's openat2() with RESOLVE_BENEATH), and always show users the real resolved path in confirmation dialogs. Developers can audit a fresh clone with `find . -type l` or `git ls-files -s` to spot symlinks before pointing any tool at the repo.

    #security#git#ai-coding
Jul 09•14m read time•From snyk.io
Post cover image
Table of contents
What is a symlink?Can you commit a symlink to Git? (Yes, and that's the problem)What is a symlink attack, and why is it dangerous?Can an AI coding assistant be tricked by a symlink?"Outside our threat model" is a real argument, and I don't fully buy itHow do you prevent symlink attacks?Inside the Agentic Development Supply Chain
331 Impressions
Snyk's image
Snyk

Snyk's blog is a source of information and advice for developers looking to ensure the security of t...

98 Followers

•

619 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard