# GhostApproval: How AI Coding Agents Fall Victim to Symlink Attacks


Security researchers at Wiz have disclosed a critical vulnerability affecting six of the most popular AI coding assistants—exposing developers to unauthorized SSH key injection and shell code execution. Dubbed GhostApproval, the flaw exploits an informed-consent bypass where the approval dialog shows developers the wrong filename, tricking them into approving writes to sensitive system files. The vulnerability affects Amazon Q Developer, Anthropic's Claude Code, Augment, Cursor, Google Antigravity, and Windsurf.


## The Attack Mechanism


GhostApproval hinges on a deceptively simple exploit chain that leverages Unix symbolic links (symlinks) combined with flawed approval dialogs in AI coding assistants.


How it works in practice:


A malicious repository contains a symlink named project_settings.json that secretly points to ~/.ssh/authorized_keys—the file controlling SSH access to a developer's machine. When the AI assistant is asked to "set up the workspace" or "follow the README," it processes a request to add a line to project_settings.json. The assistant writes the attacker's SSH public key directly through the symlink into the authorization file.


A second variation targets shell startup files like ~/.zshrc, which execute automatically when a terminal opens. No SSH access or network connectivity is required for this variant to run arbitrary commands on the next login.


The attack is trivial to execute and requires no special privileges. A developer need only:

1. Clone or interact with a malicious repository

2. Ask the AI assistant to edit or configure files

3. Approve the file modification when prompted

4. Allow the symlink to do the rest


## The Real Vulnerability: Informed-Consent Bypass


While symlink attacks date back decades, the critical flaw lies not in the symlink itself but in how these tools present information to developers. The approval dialog shows the wrong filename.


Wiz's testing of Claude Code revealed that the agent internally recognized the true target—noting in its own reasoning that project_settings.json was "actually a zsh configuration file"—yet displayed only the harmless filename to the developer. The developer clicks Accept, believing they're editing a local config file, and the write lands on a sensitive system file instead.


This represents a textbook informed-consent bypass: the human remains in the loop, but the loop is fed false information.


### Tool-by-Tool Breakdown


| Tool | Status | CVE | Severity |

|------|--------|-----|----------|

| Amazon Q Developer | ✅ Fixed | CVE-2026-12958 | High |

| Cursor | ✅ Fixed | CVE-2026-50549 | High |

| Google Antigravity | ✅ Fixed | Pending | High |

| Claude Code | ⚠️ Disputed | — | High |

| Augment | ❌ Unfixed | — | Critical |

| Windsurf | ❌ Unfixed | — | Critical |


Critical distinction: Some tools are worse than others. Windsurf writes files to disk *before* the approval dialog appears—the prompt becomes merely an undo button after the damage is done. Augment displays no dialog at all, silently reading and modifying files outside the project directory. Even tools that retain an approval screen remain vulnerable because the screen lies.


## Wiz's Responsible Disclosure


Wiz published its findings on July 8, 2026, after reporting the vulnerability privately to all six vendors. Three have released patches:


  • Amazon Q Developer: Fixed in Language Server 1.69.0; updates install automatically
  • Cursor: Fixed in v3.0 via the extension manager
  • Google Antigravity: Fixed (CVE pending); users should update immediately

  • Two vendors have acknowledged the issue but released no patch:

  • Augment: No fix; users should avoid pointing the tool at untrusted repositories
  • Windsurf: No fix; same mitigation applies

  • Anthropic's position adds nuance: the company disputes the classification, arguing the scenario falls "outside our threat model." Anthropic's reasoning: developers explicitly chose to trust the folder when launching the session and then approved the edit, so the decision was theirs. The company notes that Claude Code included symlink warnings in early February 2026—before Wiz's private report—as routine hardening. However, Wiz's testing showed that warning was insufficient; the core issue (approval dialog showing the wrong file) remains unaddressed.


    ## Real-World Implications


    This vulnerability represents a novel supply-chain attack vector in an era when developers increasingly rely on AI assistants for daily work.


    Who is at risk:

  • Individual developers using AI coding agents on their local machines
  • Engineering teams that point agents at third-party repositories or community code
  • Organizations integrating AI assistants into CI/CD pipelines
  • Open-source maintainers whose projects could be compromised and used as attack staging grounds

  • Attack surface expansion:

    An attacker doesn't need to compromise the AI vendor's infrastructure. Instead, they poison a single repository—whether a fork of an open-source project, a private package, or a deliberately public honeypot—and wait for developers to run an AI assistant against it. The barrier to entry is extremely low.


    ## Recommendations


    For developers (immediate):

  • Update all AI coding assistants to the latest version
  • Treat approval prompts with skepticism; verify the filename being modified matches your intention
  • Avoid running AI assistants on repositories you have not personally reviewed
  • Disable symlink traversal in your development environment if possible
  • Check ~/.ssh/authorized_keys and shell startup files for unexpected modifications

  • For organizations:

  • Audit which developers use which AI coding assistants in production workflows
  • Implement file integrity monitoring on developer machines for critical files (SSH keys, shell configs)
  • Restrict AI assistant access to specific project directories rather than the entire home directory
  • Require code review of all AI-generated changes before merge
  • Monitor repository clones and contributor activity for signs of attack staging

  • For vendors:

  • Resolve symlink issues immediately; follow symlinks and compare real target against approval dialog
  • Display the full, real file path in approval dialogs—not the symlink name
  • Never write to disk before showing approval prompts
  • Always show explicit approval for out-of-project file modifications
  • Consider disallowing modifications outside the project root entirely

  • ---


    ## HackWire Analysis


    GhostApproval exposes a fundamental tension in how AI coding agents balance autonomy with safety. The vendors' varying responses reveal deeper disagreements about threat modeling in an AI-assisted development world.


    Anthropic's position—that developer intent matters, therefore the approval suffices—misses the point. Informed consent requires accurate information. An approval dialog that names the wrong file is worse than no dialog at all; it creates false confidence. The fact that vendors initially missed this vulnerability suggests they shipped these tools without adequately modeling symlink attacks, which have been a staple of Unix security for over 30 years.


    What strikes us most is the *pattern*: as AI agents gain power to modify files, run commands, and access credentials, their security boundaries are lagging behind. We've seen similar gaps in other AI agent research—privilege escalation through misaligned tool use, prompt injection attacks on agent reasoning, and agents writing to unintended locations. GhostApproval is the first to achieve end-to-end system compromise through a single approval bypass, but it likely won't be the last.


    The broader risk is adoption velocity outpacing security hardening. Developers are integrating these tools into their daily workflows before vendors have tested against standard attack patterns. Symlink traversal is not exotic; it's Unix 101. That Wiz had to report it separately to six vendors suggests these tools entered production without basic file-system security review.


    This is a tractable problem—all three vendors who've patched already fixed it. But the incident underscores that AI coding agents are now critical infrastructure in developer workflows, and they need the security rigor of production systems, not experimental tools. Vendors should publish their threat models explicitly, vendors and enterprises should invest in file-integrity monitoring, and developers should treat AI-generated code changes with the same skepticism they'd apply to untrusted pull requests.


    — *HackWire Editorial*


    ---


    ## Related Coverage


  • Read more in our [Vulnerabilities](https://www.hackwire.news/category/vulnerabilities) coverage
  • Cross-reference with [AI Security](https://www.hackwire.news/category/ai-security) and [Supply Chain](https://www.hackwire.news/category/supply-chain)
  • Stay current via the [HackWire homepage](https://www.hackwire.news/)