/

CVE-2026-33654

Severity:

CRITICAL RISK

(9.8)

Prompt Injection / AI Instruction Manipulation

CVE-2026-33654

Analyzed

Vulnerability type

Category:

Prompt Injection / AI Instruction Manipulation

CWE:

CWE-94, CWE-290, CWE-1336

Impact:

Remote, unauthenticated arbitrary LLM instruction execution with potential tool/system action compromise

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Nanobot's email channel processing module treats incoming email content as highly trusted instructions for the language model, enabling indirect prompt injection that can override intended behavior.

A remote, unauthenticated attacker can send a crafted email to the monitored address and cause the assistant to execute arbitrary LLM instructions and downstream system tool actions without any interaction from the bot owner.

Affected context

This vulnerability occurs when Nanobot is configured with an active email channel that:

  • Automatically polls and ingests new emails from a monitored inbox
  • Forwards email bodies (and possibly subject/metadata) directly into the LLM as trusted context
  • Allows the LLM's responses to drive system tools, plugins, or automations without strict output validation

In such setups, the email channel acts as a high-trust input source, so any external email content can silently influence the assistant's internal reasoning and tool invocation logic.

Exploit preconditions

  • Attack surface: Network-exposed email inbox monitored by the Nanobot instance.
  • Required access: Ability to send email to the bot's monitored address (no authentication needed beyond standard email delivery).
  • Trigger point: Automatic polling and processing of new emails by nanobot/channels/email.py, with no user interaction required.
  • Why exploitation is possible:
  • Email content is injected into the LLM prompt as highly trusted instructions instead of being treated as untrusted user content.
  • There are insufficient guardrails, content separation, or instruction hierarchies to prevent external text from overriding or bypassing system and developer messages.
  • The LLM is permitted to call tools or perform actions based on the manipulated prompt, allowing the attacker's instructions to propagate into system-level behaviors.

Why this happens

The core issue lies in the email channel's trust model and prompt construction.

Incoming emails are effectively concatenated or embedded into the LLM conversation in a privileged position, without:

  • Proper delimitation between untrusted user content and trusted system or developer instructions
  • Robust instruction hierarchy enforcement that prevents external text from altering system-level behavior
  • Output-constrained interfaces that limit what the LLM can subsequently command tools or automations to do

This aligns conceptually with:

  • CWE-94 (Improper Control of Generation of Code): The LLM's natural language instructions are treated as operational logic that can dynamically drive tool or system actions, and external input can modify this "generated code."
  • CWE-290 (Authentication Bypass by Spoofing): The email content is implicitly treated as if it were trusted/owner-originated instructions, effectively bypassing intended channel trust boundaries.
  • CWE-1336 (Improper Neutralization of Special Elements Used in a Template Engine): The prompt template for the email channel does not neutralize or constrain instruction-like patterns, allowing untrusted email text to escape its intended data role and influence control flow.

At an abstract level, this is an insecure pattern in which untrusted, remote content is given directive power over an AI agent's reasoning and its tool interfaces without clear separation between data and control.

Potential impact

  • Attacker-controlled execution of arbitrary instructions within the LLM's reasoning context
  • Unauthorized invocation of system tools or plugins accessible to the Nanobot instance
  • Silent exfiltration of sensitive data that the bot can access (e.g., files, calendars, internal APIs)
  • Manipulation or deletion of user data through automated actions triggered by the LLM
  • Covert persistence of malicious instructions embedded in conversation history or notes
  • Abuse of the bot's identity to send deceptive or phishing responses on behalf of the owner

General mitigation guidance

Effective mitigation focuses on re-establishing strict trust boundaries for AI inputs and outputs, particularly for autonomous channels:

  • Demote external email content to untrusted user input:
  • Ensure that email bodies are always represented as data from an untrusted user role, never as system or developer instructions.
  • Use explicit markers and delimiters (e.g., quoting and structured containers) so the model can reliably distinguish between instructions and raw content.
  • Enforce strong instruction hierarchy and channel isolation:
  • Design prompts where system and developer messages are clearly separated from channel content, and explicitly instruct the model to ignore any attempt by user content to modify its core rules.
  • Maintain per-channel policies so that text arriving from the email channel cannot bypass global safety or authorization checks.
  • Constrain tool and automation interfaces:
  • Implement least-privilege design for tools: restrict actions, scopes, and accessible resources by default.
  • Require explicit policy checks or rule-based filters before executing tool calls suggested by the model, especially when the trigger is remote, unauthenticated input.
  • Introduce validation and gating for high-impact actions:
  • Use intermediate decision layers (e.g., rule engines, allowlists, approval workflows) to vet actions derived from LLM output.
  • Prefer idempotent, low-risk operations by default, reserving destructive or sensitive operations for paths that include human review or additional authentication.
  • Harden prompt templates against injection:
  • Treat prompts as structured templates with well-defined slots for untrusted content, rather than free-form string concatenation.
  • Apply patterns such as role-based message separation, content labels, and meta-instructions that clearly restrict how the model should interpret embedded text.

How teams detect issues like this

Detecting this class of vulnerability benefits from a mix of code-level and behavior-level analysis:

  • Static analysis and code scanning:
  • Search for channels or integrations that ingest external data (email, webhooks, web content) and feed it directly into LLM prompts.
  • Flag patterns where untrusted content is interpolated into system or developer messages, or placed ahead of safety instructions in the prompt.
  • Identify code paths that allow LLM output to directly trigger tool invocations or system actions without intermediary policy checks.
  • Structured code review:
  • Review prompt construction logic in modules like nanobot/channels/email.py, ensuring clear role separation and explicit treatment of untrusted content.
  • Examine tool and plugin interfaces to verify they enforce authorization, rate limits, and scope restrictions independently of the model's reasoning.
  • Look for comments or logic implying that certain channels are "trusted" without a robust verification mechanism.
  • Runtime monitoring and anomaly detection:
  • Monitor logs of LLM conversations and tool invocations originated from automated channels for unusual patterns, such as:
  • High-risk commands triggered immediately upon email receipt
  • Sequences of actions that appear inconsistent with typical owner behavior
  • Implement alerts when remote, unauthenticated channels cause access to sensitive resources or execute potentially destructive operations.
  • Automated security testing:
  • Use red-team style prompts and templated adversarial emails to test whether channel inputs can override system instructions or trigger unauthorized tool use.
  • Integrate such tests into CI pipelines to detect regressions in prompt-hardening logic.

Sources

SourceLink
github.comgithub.com/HKUDS/nanobot/security/advisories/GHSA-4gmr-2vc8-7qh3

Frequently asked

questions

The issue is highly exploitable because it only requires the ability to send an email to the bot's monitored address. No authentication or user interaction is needed, and the attack can be carried out remotely, making it suitable for broad, opportunistic exploitation.

No. The attacker simply needs to deliver email to the monitored inbox. The vulnerability stems from how the email channel processes message content, not from any compromise of the host or email credentials.

Treat all channel content as untrusted user input; ensure it is clearly separated from system and developer instructions; apply strict instruction hierarchies; and introduce policy layers between LLM output and any tools or system actions. In short, re-establish the data-versus-control boundary and apply least privilege to what the model can cause the system to do.

Adopt secure-by-design patterns for AI integrations: explicitly model trust levels for each input source, harden prompt templates against instruction injection, constrain tool capabilities, and use automated tests and code review checklists focused on LLM input handling and tool invocation pathways. Regular adversarial testing of new channels and automations helps catch regressions early.

Find out what's already
exploitable in your codebase.