Skip to content
Path traversal Write-up Intermediate

GhostApproval: A Trust Boundary Gap in AI Coding Assistants

A malicious repository can contain a symbolic link that points outside the workspace, and AI coding assistants follow it to read or write sensitive files such as SSH keys. The confirmation dialog often shows only the link name, not the real target, so the user approves an action they do not understand.

Maor Dokhanian Follow

Published on wiz.io

The value of AI coding assistants is simple and straightforward: the agent proposes an action, then you approve. Before any file is modified, a confirmation dialog appears: the Human-in-the-Loop safety net that keeps you in control.

Maor Dokhanian, on wiz.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the AI coding assistants did not resolve symbolic links to their real target before showing a confirmation prompt or writing to disk, so the user approved a harmless-looking path while the actual write went to a sensitive file outside the workspace.

Impact

An attacker could achieve remote code execution on the developer's machine by writing an SSH key or shell configuration, and in some tools the write happened before any confirmation; Anthropic disputed the issue as outside its threat model, while AWS, Cursor and Google fixed it.

What the attacker needed

Victim clones a malicious repository; victim asks the AI assistant to set up the workspace; AI assistant follows symbolic links

The fix

The tools should resolve symbolic links before showing prompts, warn when the resolved path is outside the workspace, and never write to disk before explicit user authorisation; AWS, Cursor and Google have fixed the issue.

How it was found

  1. Create a repository containing a symbolic link disguised as a normal project file, pointing to a sensitive file outside the workspace.
  2. Add instructions in the repository telling the AI assistant to update that file.
  3. The victim clones the repository and asks the AI assistant to set up the workspace or follow the instructions.
  4. The assistant follows the symbolic link and writes to the sensitive target, sometimes before showing a confirmation dialog.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A symbolic link is a file that acts like a shortcut to another file. If a program follows the shortcut without checking where it really leads, it can end up reading or changing a file the user never intended to touch. Here, AI coding assistants followed such shortcuts and wrote to sensitive files like SSH keys, sometimes before the user even confirmed.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by Maor Dokhanian

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.