A generated abstract illustration on a pale slate field: a tall vertical boundary runs through the frame as a dashed line with small gate marks. On its left sits a compact cluster of thin-outlined rectangles suggesting a terminal session; on its right, a single amber line leaves that cluster, passes around the end of the dashed boundary rather than through a gate, and reaches a dark rounded block. Below the boundary a band of small uniform grey shapes, each capped with a flat bar, stands for commands that were stopped. The amber path is the only line that crosses. No text, numbers, people, brand marks or organisation logos appear anywhere. The composition is flat, geometric and diagrammatic, with a blueprint grid behind. The OrcaRouter logo is composited in the bottom-right corner.
AI Safety Incidents

Cursor allowlist bypass CVE-2026-22708

Author

jinhao.song

Date Published

Latest models · 20View all models →
Benchmarks: Artificial Analysis · updated daily
Back to all posts

Pillar Security published research on 14 January 2026 describing a bypass in Cursor, the AI code editor made by Anysphere, that let shell built-in commands run without approval even when the user's command allowlist was empty. Cursor's own advisory, GHSA-82wg-qcm4-fp2w, was published the same day and tracks the flaw as CVE-2026-22708, affecting every Cursor build up to and including 2.2. The built-ins — export, typeset, declare, readonly, unset and local — are not standalone executables, so Cursor's server-side evaluator never classified them as commands needing validation, and they were executed on the spot. An attacker who reaches the agent through direct or indirect prompt injection can use them to set, change or delete environment variables, then wait for an ordinary approved command such as git branch or python3 to run attacker code. Pillar demonstrated both zero-click variants, which need no approval at all, and one-click variants, where the user approves a command that only looks benign. Neither the advisory nor the research records anyone being attacked this way in the wild. The record behind this account, including the disclosure timeline that rests on one source and the changelog date that does not line up, sits in the AI incident archive, filed under research rather than incident.

What the allowlist was actually checking

Cursor shipped two controls intended to stop the agent from running commands a user had not agreed to. The first was a user-editable allowlist of trusted commands, so that repeated calls to git, npm or python3 would not prompt every time. The second was a server-side evaluator that inspects each command and decides whether it is a real executable, prompting the user for anything it does not recognise.

Pillar's finding is that the second control had a hole the size of the shell. Built-ins such as export and unset are not programs on disk; they are functions of the shell session itself, so the evaluator had nothing to classify and marked them safe. They ran without an approval prompt whether or not the allowlist contained anything. That is the part of the finding that is easiest to understate: an empty allowlist, which a cautious user would read as the strictest possible setting, was not stricter than a populated one for this class of command.

The consequence is that the security control validated which command would run but not the environment it would run in. Environment variables are part of a command's behaviour, not separate from it. Pillar quotes Cursor's own guidance to the same effect: "We have an allowlist feature, but it's not a security guarantee. The allowlist is best-effort — bypasses are possible." Cursor's current documentation says the same thing in its own words, describing the run modes as ranging "from a simple allowlist to the Auto-review classifier" and calling them "best-effort guardrails rather than a hard security boundary."

The chains Pillar demonstrated

Pillar published working proof-of-concept chains in two classes. Each one begins with a command that produces no prompt.

• Zero-click, persistent file write. The export built-in, chained with an empty here-string and a redirection operator, appends attacker-controlled text to the zsh startup file ~/.zshrc. No traditional command such as echo or cat is invoked, so the sanitiser does not recognise a file write. The appended line runs at the start of every new shell session, which makes the payload persistent rather than one-shot.

• Zero-click, immediate execution. The typeset built-in, with the zsh parameter-expansion flag (e) and the default-value operator, forces a string to be re-evaluated as code. In Pillar's example the parameter name is left empty so the default value is substituted, and that value is a command substitution. Nothing prompts, and the sanitiser sees no command substitution because the payload arrives as a literal string. The same file notes that declare is an alias for typeset.

• One-click, pager hijack. Setting PAGER to a command makes git and man run that command when they would normally page their output. The user approves git branch; the shell runs the poisoned pager. Pillar notes the same path works through other variables, including GIT_ASKPASS, though those require more user interaction.

• One-click, interpreter chain. Three exports set PYTHONWARNINGS, BROWSER and PERL5OPT. The next python3 invocation then imports a module that opens a URL, the BROWSER variable points that open at a Perl script installed alongside Python, and that script honours PERL5OPT, which carries the attacker's Perl code. Pillar credits the underlying technique to Luke Jahnke's 2020 research on environment variable attacks and says the chain was used in its demonstration to rewrite ~/.zshrc and to read the user's SSH private key.

A self-built HTML card headed 'Four ways past the allowlist', kicker 'What Pillar Security demonstrated in Cursor', subtitle naming the four proof-of-concept chains and the built-in each one starts from. Four horizontal rows. Row one, labelled zero-click: export, chained with an empty here-string and an append redirection into the zsh startup file, writes attacker text that runs at the start of every new shell session. Row two, labelled zero-click: typeset with the zsh (e) expansion flag and the default-value operator re-evaluates a string as code, with no prompt and no command substitution visible to the filter. Row three, labelled one-click: export sets PAGER to a command, and the next approved git branch or man call runs it. Row four, labelled one-click: export sets PYTHONWARNINGS, BROWSER and PERL5OPT in sequence, and the next python3 call executes Perl code. A band below reads 'The control that failed: each of these built-ins is a function of the shell session, not an executable on disk, so the server-side evaluator had nothing to classify and executed it without approval, including when the allowlist was empty.' A footer reads 'Sources: Pillar Security, The Agent Security Paradox, 14 January 2026; Cursor advisory GHSA-82wg-qcm4-fp2w. Hand-built card, not a screenshot of any vendor page.'

Five months between the report and the fix

Pillar's own disclosure timeline is the most useful part of the record for anyone judging how agent-tool security is being handled. The vulnerability was reported to Cursor on 11 August 2025. Cursor acknowledged it that month. In September 2025, according to Pillar, Cursor described it as a "systemic issue" with "two major initiatives underway." The fix landed in January 2026 — roughly five months after the first report.

Pillar also states that the sandbox mitigation Cursor introduced in the interim was incomplete, addressing specific trigger paths while leaving the underlying class exploitable, which is why the firm went on to publish further chains rather than stopping at the first one.

A self-built HTML card headed 'Reported in August, fixed in January', kicker 'Disclosure timeline as Pillar Security records it', subtitle noting that the dates below are the researcher's, and that the record is dated to 14 January 2026, the day the research and the CVE record were published. Four nodes in a vertical timeline. 11 August 2025: Pillar Security reports the shell built-in bypass to Cursor. August 2025: Cursor acknowledges the report. September 2025: Cursor calls it a systemic issue and says two major initiatives are underway. January 2026: a fix ships, which Pillar describes as closing the issue; Cursor's advisory records the patched version as 2.3. A side note reads 'Corroboration: GitHub published advisory GHSA-82wg-qcm4-fp2w and MITRE's CVE record for CVE-2026-22708 on 14 January 2026; SC World reported the finding on 15 January 2026. The four timeline dates come from Pillar alone.' A footer reads 'Hand-built card, not a screenshot of any vendor page.'

What the fix does, and what it does not settle

According to both Pillar and Cursor's advisory, the fix requires explicit user approval for any command the server-side parser cannot classify. The advisory's remediation note is a single sentence: "Terminal command parsing around edge cases was improved." Cursor's current security documentation now describes Run Modes as ranging "from a simple allowlist to the Auto-review classifier" and calls them "best-effort guardrails rather than a hard security boundary"; the same pages call Auto-review "the safest useful setup for most people" and sandbox shell commands where they can. Pillar also reports that Cursor introduced guidelines discouraging allowlists, though that part of the account is the researcher's.

Pillar's position is that this closes its specific proof-of-concept paths but not the design problem. The firm argues that sanitisation and allowlists are the wrong primitive for agents that take code as input, and that command execution should run in an isolated environment with environment-variable modifications sandboxed too, rather than being gated by name matching.

One detail in the record does not line up cleanly. The advisory lists the patched version as 2.3, and Pillar's timeline puts the fix in January 2026, but Cursor's public changelog dates version 2.3 to 22 December 2025 and carries no entry describing the terminal-parsing change; its stability notes for that release mention only that the agent's handling of auto-run preferences was improved. The sources reviewed here do not explain whether the fix shipped in a 2.3.x build after that date or whether the version label and the changelog date simply refer to different things. That is a gap in the public record, not a contradiction in the finding itself.

Established, reported, and not established

Established. Shell built-ins executed without approval in Cursor's Auto-Run plus Allowlist configuration, including with an empty allowlist. The mechanism was environment-variable poisoning that turned later approved commands into code execution. Both zero-click and one-click variants were demonstrated. The flaw was credited to Dan Lisichkin of Pillar Security in the advisory. Cursor versions up to and including 2.2 were affected, and 2.3 is the patched version. GitHub, acting as the CVE numbering authority, scored it 7.2 on the CVSS 4.0 scale with a high severity rating. The advisory, the CVE record and SC World's report of 15 January 2026 agree on the mechanism, the affected versions and the fix.

Reported by one party. The four-step disclosure timeline — 11 August 2025 report, August acknowledgement, September "systemic issue" characterization, January 2026 fix — comes from Pillar alone; the advisory's public record begins on 14 January 2026 and does not narrate the earlier correspondence. The claim that the interim sandbox mitigation was incomplete rests on the same source, though the fact that Pillar published several distinct chains after it is consistent with that account.

Not established. How many users or organisations ran the vulnerable configuration, and whether anyone was attacked through it. The advisory does not quantify exposure. Pillar's proof-of-concept work is not evidence of exploitation, and neither the CVE record nor SC World's report describes any. CISA's enrichment data, attached to the CVE record on publication day, lists exploitation as none and automatable as no, with a technical impact of total. CVE-2026-22708 does not appear in CISA's Known Exploited Vulnerabilities catalog as of its 4 November 2026 revision.

A self-built HTML card headed 'Established, reported, and not established', kicker 'Reading the record', subtitle noting that the record carries a confidence grade of A and marks real harm false. Three columns. Column one, established, agreed by every cited source: shell built-ins executed without approval in Cursor's Auto-Run plus Allowlist configuration, including with an empty allowlist; the mechanism was environment-variable poisoning that turned a later approved command into code execution; zero-click and one-click variants were both demonstrated; the flaw is credited to Dan Lisichkin of Pillar Security; versions up to and including 2.2 were affected and 2.3 is the patched version; GitHub scored it 7.2 on the CVSS 4.0 scale, and CISA's same-day enrichment records exploitation as none; the advisory, the CVE record and SC World agree on mechanism, affected versions and fix. Column two, reported by one party, single-source: the four-step disclosure timeline from August 2025 to January 2026, the claim that the interim sandbox mitigation was incomplete, and Pillar's argument that approval prompts remain weaker than full execution isolation. Column three, not established, no source supports a claim: how many users or organisations ran the vulnerable configuration and whether anyone was attacked through it; that the fix shipped in a build dated after 22 December 2025, since the changelog dates 2.3 to that day and does not describe the parsing change; and any entry in CISA's Known Exploited Vulnerabilities catalog as of its 4 November 2026 revision. A footer lists the sources and reads 'Hand-built card, not a screenshot of any vendor page.'

Why this record is graded medium when the CVE reads high

The two labels measure different things and it is worth keeping them apart. The CVSS 4.0 base score, which estimates the severity of the impact if the flaw is used, comes out at 7.2; the vector records network attack, high complexity, no privileges and no user interaction, with high confidentiality, integrity and availability impact. The record itself is graded medium, with real harm marked false, which reflects what was recorded happening rather than what could have happened. A high-severity, unexercised vulnerability and a medium-severity incident record are both accurate descriptions of 14 January 2026.

The record also carries a confidence grade of A and a kind of research rather than incident, which is the correct frame: this is a disclosure and a set of proofs of concept, not a breach. Nothing in the cited sources supports describing it as an attack that occurred.

What the finding changed beyond Cursor

The technique is old — Luke Jahnke's environment-variable research dates to 2020 — and Pillar's argument is that AI agents changed its economics rather than its mechanics. What once required direct access to a machine, knowledge of which variables to chain and manual execution of each step now requires only that an agent read attacker-controlled content and follow it. The preparation is invisible; the approval, when there is one at all, lands on the harmless-looking trigger.

That is the reason the record is worth keeping even with no victims attached to it. The failure was not a missing check in one product's parser. It was a control that asked "is this command on the list?" when the question that mattered was "what will this command do in this environment?" Every agent runtime that gates shell access by command name, and that lets the same session carry state from one call to the next, has the same shape of gap.