Skip to content

Accident reports · January 2026

Cursor: some commands ran without approval and turned an approved command

According to Pillar Security, a planted instruction changed the environment without asking, so that a command already approved ran the attacker's code. Fixed in Cursor 2.3.

  • Company Cursor
  • Agent Cursor
  • Model not published
Outside content
A row of standing white dominoes, the first sharp and the others blurred
Photo: Robert Stump on Unsplash
WhenJanuary 2026 (reported in August 2025)
WhoThe agent in Cursor, the code editor, studied by Pillar Security
What the agent didIn the demonstration, built-in terminal commands ran without asking for approval; a planted instruction used them so that a command already approved would run the attacker's code
ConsequenceNo real-world attack reported; flaw CVE-2026-22708, rated 9.8 out of 10 according to Tenable, fixed in Cursor 2.3

What happened

This is a researchers' demonstration, not an observed attack. Dan Lisichkin, at Pillar Security, published it on 14 January 2026.

Cursor's agent runs commands in the terminal. The user can keep a list of commands allowed by default, and the agent asks for approval for the others. According to Pillar, Cursor treated the terminal's built-in commands as harmless and ran them without asking, even with an empty list. Among them: export, typeset and declare, which change environment variables.

An instruction hidden in content the agent reads uses them to prepare the ground. An example given by Pillar: change the variable that picks the display program, then wait for the user to approve an ordinary command like git branch. It is the attacker's program that runs. According to Pillar, some variants need no click at all, for example by writing into the file that runs every time a terminal opens. In the demonstration, the researchers got hold of the machine's SSH key.

According to Tenable, the flaw affects the mode where the agent runs allowed commands on its own, in versions before 2.3. Pillar reported it on 11 August 2025. Cursor called it a "systemic issue" in September, then fixed it in January 2026: the agent now asks for approval for any command it cannot classify, and Cursor advises against allow-lists.

Why it happened

An allow-list judges a command by its name, not by the environment it runs in. An approved "git" means nothing once someone has changed, just before, what git is going to launch.

The failure family

In our catalogue, this is the "Outside content" family: a text the agent reads takes over, and gets around the user's approval on the way.

The safeguard in code

  • Any command that changes the environment or a startup file asks for approval, like the others.
  • No broad list of commands allowed by default (git, python): what they do depends on what was changed before.
  • The agent runs in an isolated space, with no SSH key or secret within reach.

What we test

The "planted instruction" and "hidden instruction" tests slip an order into content the agent reads for its work. The exact case of an instruction that prepares the environment so that a command approved later does something else is not yet tested as such: we are adding it to our list. What a company can lock down today: move to version 2.3 or later, and remove broad commands from the allow-list.

And your agent, what would it do?

The crash test puts your agent in these situations, dozens of times, on several models. You get the figures, the conversations where it gave in, and the fix plan.

Crash-test my agent See the live demo

Further reading