AIDEFEND in Action AIA-0167 Validated Research

ProgramData Configuration Trust: A Standard Windows User Could Plant Commands That Run in Other Users' AI Coding Tool Sessions

Cymulate Research Lab found that four AI coding tools on Windows, Claude Code, Cursor, OpenAI Codex CLI and Google Gemini CLI, read a machine-wide configuration file from a vendor folder under C:\ProgramData, where a standard user can create folders and files by default. A user without administrator rights could plant a file there that defines a hook (a command the tool runs automatically on an event such as session start) or a Codex notify command, and the command then runs in the account of whoever next uses the tool on that machine, including an administrator. Anthropic fixed Claude Code in 2.1.75 (CVE-2026-35603, a public vulnerability identifier that covers Claude Code only); Cymulate reports no committed fix for the other three tools when it wrote, and there is currently no public evidence of real-world use.

Privilege EscalationConfiguration PoisoningConfiguration ReviewClient SecurityAI Coding Agent
4 applicable AIDEFEND defenses
Source: CVE-2026-35603: One Writable Folder, Every User Compromised: Exploiting Configuration Trust in AI Coding Tools 
Authors: Ilan Kalendarov, Ben Zamir, Elad Beber (Cymulate Research Lab)
Original article: Jun 17, 2026

Threat Analysis

  • A shared folder that any user can write to. C:\ProgramData holds application data shared by every user of a Windows machine, and Cymulate notes that its default permissions let ordinary users (the Users group) create subfolders and files there. Each of the four tools reads a machine-wide configuration file from its own subfolder: Claude Code from C:\ProgramData\ClaudeCode\managed-settings.json (tested on version 2.0.76), Cursor from C:\ProgramData\Cursor\hooks.json, Codex CLI from C:\ProgramData\openai\codex\config.toml and Gemini CLI from C:\ProgramData\gemini-cli\system-defaults.json. In Cymulate's tests no tool created or restricted that subfolder at install time, and none checked the file's owner or integrity before loading it.
  • How a planted file becomes a command in someone else's session. A standard user, or malware running as that user, creates the missing folder and writes a configuration file that points the tool's event-triggered command feature at a command of their choice; no elevation is needed. When another user works with the tool, the configured event fires. In Cymulate's examples that is session start for the Claude Code and Gemini CLI hooks, a prompt sent to an agent for the Cursor hook, and each agent turn for the Codex CLI notify command. The tool runs the command with that user's identity and permissions, outside any sandbox, and Cymulate reports no approval dialog, signature check or warning. No prompt injection or model decision is involved, so prompt filters and model-side safeguards never see this path.
  • What the attacker gains. The command can reach whatever the victim's account can reach; Cymulate lists environment variables, source code, SSH keys, cloud tokens and Git credentials. If an administrator launches the tool, a standard account has obtained administrator-level execution, which is a local privilege escalation, and because the file stays in place the command runs again at every later launch. For Codex CLI, the same planted config.toml can also set sandbox_mode = "danger-full-access" and approval_policy = "never", which removes the sandbox and the approval prompts from the victim's agent session. These are the capabilities Cymulate validated; its article does not report data taken from a real victim or a later agent action under the changed settings.
  • Claude Code: fixed in 2.1.75. Cymulate reported the issue on January 5, 2026. Anthropic retired the ProgramData location, moved managed settings (settings that enterprise IT deploys centrally) to a write-protected Program Files path, and notified affected enterprise customers before the change went out. Its advisory of April 17, 2026 scores the flaw 5.4 under CVSS v4 (Moderate), lists versions before 2.1.75 as affected and 2.1.75 as patched, and notes that the attack needed a shared multi-user Windows system and a victim who launched Claude Code after the malicious file was placed.
  • The other three: no committed fix when Cymulate wrote. According to Cymulate's article (published June 17, 2026, last updated August 11, 2026), Cursor received the report on January 12, 2026 and had given no formal verdict more than five months later, with the issue still reproducible. The Codex CLI report was submitted through the bug bounty platform Bugcrowd on February 16, 2026 and validated as reproducible; after more than two months it was moved to Unresolved with no fix or timeline. For Gemini CLI, the formal reply from the Google Cloud Vulnerability Reward Program was that the finding "will be addressed as a documentation update". As of November 2026 the Cursor and Gemini CLI documentation still lists these ProgramData paths without saying how the folder is permissioned, so teams should check their own endpoints and not assume the status has changed.

Applicable AIDEFEND Defenses (4)

AID-I-004.006
Agent Identity & Persistent State File Write Protection
Very High
Windows endpoint administrators use Group Policy or a configuration-management tool to create the four vendor folders under C:\ProgramData on every managed endpoint, owned by Administrators or SYSTEM, without the inherited permissions that let the Users group create files and subfolders. A standard user then cannot create the folder or add a file, so planting fails before any tool reads a setting. Folders that already exist must be taken over too, because whoever created a folder can rewrite its permissions. Auditing the same folders sends every create or change attempt, allowed or denied, to the SIEM with the acting account. That is detection: it finds endpoints the baseline missed and files planted earlier, but it cannot stop a command a tool has already loaded.
AID-H-003.010
Deployed AI Software Vulnerability Remediation Lifecycle
High
For Claude Code a vendor fix exists and the researchers retested it: update every Windows installation to 2.1.75 or later and read the installed versions back from the fleet, manually updated installations first. This closes the Claude Code path only. Cursor, Codex CLI and Gemini CLI had no committed fix in Cymulate's account, so keep each as an open finding, record the folder restriction as a compensating control with an owner and an expiry date, and retest after every vendor release.
AID-E-003.003
Confirmed Malicious Code & Persistence Eviction
High
Once a planted file is confirmed, responders preserve it together with any script or binary it points to, remove it from the machine-wide path, reapply the folder restriction, and confirm from a second account that no hook or notify command fires. Removal only stops later launches from running the command. Processes the command already started have to be ended separately, and credentials reachable in the sessions where it ran have to be revoked at their issuers.
AID-H-021.001
Client-Side Configuration Enforcement
Medium
Where the folder restriction is not in place yet, an EDR content rule scoped to the four configuration paths can send any file containing a hook or notify command definition, or the Codex settings sandbox_mode = "danger-full-access" and approval_policy = "never", to quarantine or review. It needs a product that scans file content on create and modify events, keyword rules can be evaded, and a launch before quarantine still runs the command, so it is a compensating check and not the primary boundary.

What Defenders Should Do Now

  • Lock the four folders, then prove it. Start with machines that more than one person signs in to: shared build hosts, jump boxes and laptops that IT administrators also log on to. Use Group Policy or your configuration-management tool to create the four vendor folders on every managed Windows endpoint, owned by Administrators or SYSTEM, with only those two allowed to create or change files. Then sign in with a standard test account and try to create the folder, add a file to it and overwrite an existing file. All three must be denied, and an update pushed by the management tool must still succeed. Check as well for configuration files already in those folders that IT did not deploy.
  • Update Claude Code and move its managed settings. Confirm that every installation reports version 2.1.75 or later, and handle manually updated installations first. If your organization deploys managed settings, place them at C:\Program Files\ClaudeCode\managed-settings.json. Anthropic's documentation states that Claude Code no longer reads the old ProgramData path, so a policy file left there does not take effect.
  • Keep the other three tools on the open-findings list. Record the folder restriction for Cursor, Codex CLI and Gemini CLI as a compensating control with an owner and a review date. After each vendor release, repeat the test on an isolated machine that does not have the restriction: as a standard user, plant a harmless configuration whose command only writes a marker file, start the tool from a second account, and see whether the marker file appears. Close the finding only when the marker no longer appears or the vendor formally documents a fix.
  • Monitor the folders, and know what to do on a hit. Send file-creation and file-change events for the four folders to your SIEM, alert whenever the writing account is not the management tool or an administrator, and generate a test event to confirm the alert arrives. If you find a planted file, keep a copy, remove it and restore the folder restriction. Then work out which accounts started the tool after the file was created, and at each issuing service revoke and reissue the credentials those sessions could reach, such as SSH keys, cloud tokens and Git credentials.

2 additional considerations

Keep AI coding tools out of administrator sessions

The escalation in this case happens when an administrator starts one of the tools on a machine that a lower-privileged user can also sign in to.
Recommendation: Identity and endpoint administrators can give IT staff a separate standard account for development work and keep these tools off shared hosts such as jump boxes where that is practical. This removes the administrator-level outcome; a planted command would still run in other standard users' sessions, so the folder restriction stays necessary.

Process monitoring for hook and notify commands

A planted hook or notify command makes the AI coding tool start a shell or script as a child process at a predictable moment, such as session start or the end of an agent turn.
Recommendation: Security operations teams with endpoint detection tooling can alert when one of these tools starts a command interpreter and the command is not in the approved configuration. This needs process-creation telemetry with the parent process and command line, it fires after the command has started, and it needs tuning where teams already use hooks.

Conclusion

A configuration file that can make a tool run commands needs the same write protection as the program itself, and a folder under C:\ProgramData does not get that protection unless someone sets it. AIDEFEND  maps this attack path to write protection for agent configuration files: with the four vendor folders locked down, a standard account cannot even place the file. Around that primary boundary sit remediation tracking for the patched and unpatched tools, an endpoint rule on configuration content, and eviction of a confirmed planted file.

Last updated: