TL;DR: A critical Cursor flaw let attackers bypass command allowlists and “Ask Every Time” prompts by wrapping malicious commands in triple backticks, enabling arbitrary command execution through prompt injection, according to Noma Security. The issue shows how AI-assisted development can collapse traditional approval gates when parser logic and execution controls diverge.
At a glance
What this is: Noma Security identified a CVSS 9.2 Cursor flaw that allowed prompt-injected commands to bypass terminal guardrails and execute arbitrary shell actions.
Why it matters: This matters because AI-assisted code editors can turn untrusted content into command execution paths, exposing developer credentials, source code, and downstream enterprise systems.
👉 Read Noma Security's analysis of the Cursor terminal guardrail bypass
Context
AI code editors now sit on the boundary between natural language input and system-level execution, which creates a governance problem as much as a technical one. When an editor can interpret hidden instructions inside markdown, comments, or imported content, the control plane for command approval is no longer just the user prompt, but the parser and execution pipeline behind it. In practice, that means prompt injection becomes a command execution issue, not only an LLM safety issue.
The Cursor case is especially relevant for teams governing developer endpoints, secrets, and software supply chains. A compromised editor session can expose credentials, modify build logic, or open a path into internal systems through the developer workstation. That makes the article a clear example of how AI tooling now intersects with IAM, secrets management, and non-human identity governance in day-to-day engineering workflows.
Key questions
Q: What breaks when AI coding tools can turn untrusted content into shell commands?
A: The approval model breaks. If markdown, comments, or embedded instructions can influence execution, then allow-lists and approval prompts no longer validate human intent. The control failure is a trust boundary mismatch between text parsing and command execution, which means a malicious repository or document can trigger actions the user never knowingly authorised.
Q: Why do AI editors create new identity and privilege risks for development teams?
A: Because they behave like software actors with access to files, commands, and secrets. Once a tool can act on a developer’s behalf, it needs scoped permissions, logging, and revocation like any other privileged identity. Without that, the editor becomes a high-value execution surface rather than a passive productivity aid.
Q: How do security teams know runtime AI guardrails are actually working?
A: Look for blocked poisoned inputs, flagged anomalous outputs, and traceable enforcement before responses reach users or downstream systems. If controls only inspect prompts or only inspect outputs, they leave a gap that attackers can exploit through manipulated data sources or tool responses.
Q: Who is accountable when an AI coding tool bypasses a terminal safeguard?
A: Accountability usually sits with the organisation that allowed the tool to reach sensitive commands and secrets without a separate policy boundary. Security, platform engineering, and application owners all share responsibility because the failure spans endpoint control, identity governance, and software supply chain risk.
Technical breakdown
How markdown parsing can override terminal approval logic
Cursor’s flaw emerged where formatting-aware parsing and terminal authorization diverged. Triple backticks are meant to signal preformatted content, but in this case the parser accepted encapsulated commands in a way that bypassed allow-list checks and “Ask Every Time” prompts. The technical problem is not simply insecure input handling. It is a mismatch between the representation layer that reads text and the execution layer that launches commands. Once the model or parser can reshape untrusted text into trusted-looking structure, the guardrail is no longer enforcing a true policy decision.
Practical implication: treat formatting-aware parsing as part of the trust boundary, not a cosmetic feature.
Indirect prompt injection as a command execution path
Indirect prompt injection happens when malicious instructions are hidden in content the system ingests from outside the immediate user prompt, such as markdown files, code comments, or documentation. In AI-assisted development tools, that content can influence downstream tool calls if the model is permitted to act on it. The risk is higher when the editor can translate inferred intent into shell commands, file writes, or repository changes. This is a governance failure because the system confuses untrusted context with authorised operator intent.
Practical implication: isolate external content from tool authorization and require explicit policy checks before any execution path.
Why AI editor permissions create a workload identity problem
An AI-powered editor is not just a user interface. It behaves like a software actor that can issue commands, read files, and access credentials on behalf of the developer. That makes its runtime privileges a form of non-human identity, even if the workflow feels human-led. If the editor can access .env files, SSH keys, or cloud tokens, then command execution control becomes part of NHI governance. The important question is not whether the model is intelligent, but whether its tool use is scoped, monitored, and revocable like any other privileged software identity.
Practical implication: classify AI coding tools as privileged software identities and govern their permissions accordingly.
Threat narrative
Attacker objective: The attacker aims to convert untrusted content into silent command execution, then use the compromised development workstation to steal secrets or manipulate the software supply chain.
- Entry occurs when a malicious markdown block or similar external content is opened inside the AI-powered editor and parsed as trusted context.
- Credential access or execution happens when the triple-backtick obfuscation bypasses command approval and causes the editor to run arbitrary shell commands without user confirmation.
- Impact follows as the attacker can read secrets, alter build scripts, or use the workstation as a foothold for further compromise.
NHI Mgmt Group analysis
AI editors are becoming privileged software identities, not just developer tools. Once a code editor can read context, choose actions, and launch commands, it must be governed as a non-human identity with scoped privileges and auditable behaviour. The Cursor flaw shows that human approval alone is not a sufficient control when the software can reinterpret untrusted content into execution. Practitioners should treat the editor-runtime boundary as an identity problem, not only an application security issue.
Prompt injection becomes materially more dangerous when it reaches command execution. Many AI safety discussions stop at content manipulation, but this case demonstrates that the real risk begins when injected context can alter tool use. That shifts the issue from model behaviour to operational control failure, because the attacker no longer needs to convince the user directly. Practitioners should evaluate where model output can become system action without a separate policy gate.
Markdown-aware execution creates a trust mismatch that security teams often miss. The failure mode is not merely “bad input,” but a parser that reclassifies dangerous content into an execution-safe form. That kind of mismatch can bypass allow-lists, review prompts, and other controls built around visible user intent. The named concept here is parser-execution trust gap, and it should be considered whenever AI tools translate text into commands. Practitioners should redesign guardrails so formatting cannot influence authorisation.
This flaw shows why AI development environments need supply-chain and secrets governance together. A compromised editor can expose credentials, modify code, and influence build artefacts in the same session. That means secret storage, workstation hardening, and repository trust all interact at once. Security programmes that separate endpoint, IAM, and AI governance will miss the shared failure surface. Practitioners should unify those controls around the developer workflow, not the product category.
The broader market signal is that AI security for development tools is converging with NHI governance. Once the tool can autonomously issue shell commands and touch sensitive files, its permissions, lifecycle, and monitoring need the same scrutiny as other machine identities. That is the governance direction the market is moving toward, whether teams label it AI safety, developer security, or NHI control. Practitioners should expect vendor claims about “guardrails” to be tested against real execution boundaries.
What this signals
Parser-execution trust gap: AI development tools now expose a governance flaw that sits between content interpretation and command authorization. If formatting can change whether a command is treated as safe, the control model is already failing and the programme needs explicit separation between untrusted input and privileged execution.
The next maturity step is to govern AI editors like privileged software identities, with scoped access, short-lived credentials, and audit trails tied to the developer workflow. That approach aligns with modern identity governance and with the broader direction of zero-trust control design.
Teams should also expect more scrutiny of how AI tools interact with secrets, repositories, and build automation. The practical signal is simple: if an editor can reach a secret or mutate a release path, it belongs inside the same governance boundary as other high-risk machine identities.
For practitioners
- Reclassify AI coding tools as privileged software identities Inventory AI editors, coding assistants, and agent plugins as runtime actors with assigned permissions, secret access, and audit requirements. Tie them to owner, purpose, and revocation process the same way you would for service accounts or bots.
- Separate prompt ingestion from command authorisation Enforce a hard policy boundary between untrusted content and any shell, file write, or repository action. Review whether markdown, comments, and imported files can influence execution decisions without a dedicated authorization layer.
- Restrict secret exposure in developer workstations Remove long-lived credentials from local environments where AI tools can access them, and use short-lived access where possible. Prioritise .env files, SSH keys, and cloud provider credentials in endpoint policy and secrets scanning.
- Test guardrails against indirect prompt injection Run adversarial tests that hide instructions in markdown, code comments, and repository artefacts to see whether the editor can be tricked into tool use. Validate that allow-lists still hold when formatting or parser behaviour changes.
- Tie AI tooling to software supply chain controls Treat AI-assisted code changes as part of the build and release attack surface. Require review for changes to build scripts, internal configuration, and automation files that an editor or agent can modify.
Key takeaways
- The Cursor flaw shows that AI-assisted development can turn markdown parsing errors into arbitrary command execution.
- The impact reaches far beyond the editor itself, with risks to secrets, source code, and software supply chains.
- The control that matters most is a hard separation between untrusted context and privileged execution, backed by NHI-style governance for AI tools.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10, OWASP Agentic AI Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 | The article centers on untrusted prompts driving privileged tool use. |
| OWASP Agentic AI Top 10 | A2 | Prompt injection and tool misuse are central to the bypass path. |
| MITRE ATT&CK | TA0002 , Execution; TA0006 , Credential Access; TA0010 , Exfiltration | The flaw enables command execution followed by secret theft or data exfiltration. |
| NIST CSF 2.0 | PR.AC-1 | Access control must cover tool execution, not just user login. |
| NIST SP 800-53 Rev 5 | AC-6 | Least privilege is the relevant control family for editor command powers. |
Map AI editor abuse to execution, credential access, and exfiltration tactics when testing controls.
Key terms
- Indirect Prompt Injection: Indirect prompt injection is an attack where malicious instructions are hidden inside content that an AI system reads later. The model may treat that content as context rather than as hostile input, which can influence tool use, data access, or workflow actions if controls are weak.
- Tool Authorization: Tool authorization is the control that decides which external actions an AI system may invoke, under what conditions, and with what constraints. For autonomous or semi-autonomous systems, it is a core identity control because unsafe tool access can turn a model response into a real-world action.
- Parser-Execution Trust Gap: A mismatch between how software interprets text and how it authorizes runtime actions. Security teams should care about this gap because formatting, encoding, or parsing behaviour can change the effective policy decision and allow dangerous commands to slip past intended guardrails.
- Privileged Machine Identity: A privileged machine identity is any non-human identity that can perform high-impact actions in systems or data stores. It may create resources, move data, approve workflows, or change configuration. The security concern is not the label, but the combination of access, autonomy, and blast radius if the identity is abused.
What's in the full analysis
Noma Security's full post covers the operational detail this post intentionally leaves for the source:
- A step-by-step proof of concept showing how the triple-backtick bypass modified internal configuration files without triggering the allow-list.
- The disclosure timeline and remediation milestones that show how the regression was confirmed and fixed.
- The platform-level control approach for intercepting prompt injection, validating tool calls, and restricting dangerous permission combinations.
- The specific workflow conditions under which the issue could expose .env files, SSH keys, and cloud credentials.
👉 The full Noma Security post covers the proof of concept, disclosure timeline, and mitigation detail.
Deepen your knowledge
NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security, and secrets management. It helps practitioners connect identity controls to the operational risks created by AI tools and privileged automation.
Published by the NHIMG editorial team on July 24, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org