External risk intelligence

AI Code Prompt Injection Leads to Arbitrary Command Execution.

CVE advisorySeverity: CRITICAL (CVSS 9.6)

CVE-2026-30304

This vulnerability exists within an AI-powered code execution tool designed for use as a Visual Studio Code extension. Such developer tools operate locally on a user's workstation within the IDE environment. They are not internet-facing services, network gateways, or public-facing applications, making public internet exposure and reachability in common deployments very unlikely.

Tianguaduizhang Ai Code

3.12.4 and earlier

Halo Surface Signal: 1 out of 5 — much less likely to be public-facing.

External exposure likelihood

Horizon Alert

Summary of the vulnerability and why it matters

This vulnerability affects an AI-powered tool that automatically executes commands within a development environment. An attacker could trick the tool into running malicious commands without user approval, potentially leading to unauthorized system access. The primary concern for leadership is to understand if this specific tool is in use and to what extent.

  • Malicious commands can run automatically.
  • Confirms if this development tool is in use.
  • Assess potential exposure and confirm relevance.

Attack Path

How an attacker could exploit the issue

An attacker could trick the AI Code extension into running any command on a user's machine by embedding malicious instructions within what appears to be a safe prompt. This bypasses the intended user approval for potentially dangerous operations, allowing the attacker to execute arbitrary code.

  • Requires no initial privileges.
  • Triggers when the model misclassifies a malicious command as safe.
  • Allows arbitrary command execution.

Live Threat

Current exploitation, exposure, and threat context

This vulnerability could allow an attacker to trick the AI Code tool into executing arbitrary commands on a user's system. This occurs when a user is interacting with the tool, and an attacker crafts a special prompt that makes the AI misclassify a malicious command as safe, bypassing the need for user approval and executing it directly.

  • Arbitrary command execution.
  • Prompt injection via crafted prompts.
  • Unauthorized system access.

Operational Fix

Recommended remediation, mitigation, and detection steps

The primary responsibility for addressing this vulnerability likely falls to the application owner and the platform or infrastructure team managing the development environment. The first practical step is to identify all instances of the affected AI Code extension, determine if these instances are accessible to potential attackers, and confirm the business criticality of any affected systems. Once ownership and risk are confirmed, a remediation plan can be established, potentially involving coordination with the vendor or implementing temporary controls.

  • Application owners and platform teams responsible.
  • Verify extension presence and network exposure.
  • Plan remediation based on confirmed risk.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is the ai_code extension for Visual Studio Code?

ai_code is a development tool designed as an extension for the Visual Studio Code environment. It uses AI models to assist developers by automatically executing terminal commands based on natural language instructions. By automating these tasks, it aims to speed up workflows, but it introduces a bridge between AI-generated logic and your local operating system's command execution capabilities.

How does CVE-2026-30304 work?

This vulnerability is classified as Improper Input Validation (CWE-20). The tool attempts to categorize commands as safe or destructive, requiring user approval for the latter. However, an attacker can use prompt injection techniques to wrap malicious commands in a template that misleads the AI model. Because the AI incorrectly flags these malicious commands as safe, the tool executes them immediately without the mandatory user authorization.

Do I need to be actively using ai_code for this to trigger?

Yes, this bug specifically relies on the tool's automated execution features. It is not triggered by simply having the extension installed or by random network traffic. The vulnerability activates only when the AI model processes a maliciously crafted prompt that you provide or interact with while the tool is active, causing it to misclassify the hidden command as benign.

Is my machine at risk from this internet-based threat?

Halo Surface Signal indicates that public internet exposure is very unlikely for this vulnerability. Because ai_code functions as a local development tool within your IDE, it does not typically act as a public-facing network service or gateway. The primary risk is limited to the local workstation environment rather than direct external network attacks from the internet.

What should I do if I use ai_code?

Your first step is to confirm whether you have this extension installed in your development environment. If identified, treat the AI's output with increased skepticism, especially when it suggests running system commands. Coordinate with your team to track the extension's usage and prepare for updates or configuration changes provided by the vendor to address the authorization bypass.

References