Back to blog
CleanIssue researchMCPcomputer usePowerShell injectionAI agents

clawdcursor: when copying a PDF runs a command

Published on 2026-11-176 min read
TL;DR: While testing clawdcursor, a tool that lets an AI agent take over a Windows PC, I found a bug that turns a plain copy-paste into command execution. All it took was a document containing certain apostrophes, retyped by the agent. The maintainer fixed it in version 1.5.26; the advisory is public as GHSA-9ppf-38v8-h97v.

The tool

clawdcursor is an open-source MCP server. Once connected to Claude Desktop, Cursor or another assistant, it hands over the mouse, keyboard and screen: the agent can open a window, read what is shown, click and type.

It is not naive. It has a safety layer that asks the user before actions it considers risky, such as opening a file or writing to the clipboard. Typing text is not on that list, which makes sense: it is the most ordinary action there is.

The demo

The task is deliberately boring. A supplier sent a PDF with a list of points to confirm; the agent has to open it and copy the list into Notepad.

The agent copies a PDF into Notepad. Calculator opens instead. Fake data, test machine.

The agent reads the PDF and calls the typing tool with the text. Instead of showing up in Notepad, part of the text runs as a command. Here it opens Calculator, which is harmless but visible. An attacker could have run something else, with the user's rights, and no confirmation prompt would have appeared.

What happens, with an analogy

Picture a clerk who takes dictation and writes it onto an order form. The rule is simple: anything inside quotation marks is text to copy as is, and anything outside them is an instruction the clerk carries out. To avoid accidents, when the dictated sentence itself contains a quotation mark, it is doubled, meaning "this mark is part of the text".

The catch is that the clerk recognises several kinds of quotation marks, while the person preparing the dictation only doubles one kind. If the sentence contains the other kind, the clerk thinks the text has ended and reads what follows as an instruction.

That is exactly what happened. To type long text, clawdcursor copied it to the clipboard with a small PowerShell script. The text was wrapped in straight single quotes (') and straight quotes inside it were doubled. But PowerShell also accepts typographic quotes, ’ and ‘, the ones most word processors produce. Those were not doubled. A document with them in the right place could close the string and add its own instructions to the script.

I am not publishing the exact text that triggers it. The principle is enough to understand it and to check your own tools.

The fix

One could simply double the typographic quotes too. But that only resets the game: one more forgotten character and the problem is back. The maintainer chose the robust option: the text is never written into the script any more. Since 1.5.26 it is handed to PowerShell separately, over standard input and base64-encoded. In the analogy, you no longer dictate the sentence; you hand the clerk a separate sheet to copy, never to be read as an instruction.

Why it matters beyond this tool

In this story the AI model made no mistake. It was asked to copy text and it copied text. It was not "manipulated" in the usual sense, and none of its answers looked suspicious.

The flaw was in the code that turns its requests into actions. That is often where to look when assessing an agent: follow every piece of outside data (an email, a PDF, a web page) to the place where it ends up executed, and check whether it can change nature there. The most mundane actions deserve the same attention as the others, precisely because nobody watches them.

Timeline

DateStep
Nov 4, 2026Private report to the maintainer via GitHub
Nov 5, 2026Version 1.5.26 and advisory GHSA-9ppf-38v8-h97v published
Nov 17, 2026This write-up, after the delay agreed to give users time to update

Thanks to the maintainer for the welcome and for a fix that addresses the cause rather than the symptom. If you use clawdcursor on Windows, move to 1.5.26 or later.

Does your product ship an AI agent? CleanIssue tests what a stranger can make it do with the Agent Red Team Express (5 days, €1,900), or a custom red team for several agents and MCP servers. First step: a free 30-minute discovery call.

Know what your agent can do before an attacker does.

A free 30-minute discovery call: you describe your agent, I tell you what I would test and what it costs. Five case studies are published.

Book a call