highAgent ThreatPrompt Injection

LLM-Mediated Web Attacks (LLM2X: Prompt Injection to Classic Web Vulnerabilities)

First seen Aug 12, 2026 · Updated Aug 12, 2026

prompt-injectionconfused-deputySSRFSQLiXSSSSTIcommand-injectionIDORCSRFXXELLM-integrated-appsresearchASI05 · Unsafe Code ExecutionAML.T0051AML.T0054Surface: Tool LayerPropagation: Single Hop

This is an academic research paper (not an active exploit report) systematizing a class of attacks called 'LLM2X', where attacker-controlled input passed through an LLM in a tool-calling or agentic pipeline is transformed and then reaches traditional web backend sinks (SQL, shell, templates, XML parsers, HTTP clients). The LLM acts as a confused deputy, laundering malicious input into classic vulnerabilities like SQLi, XSS, SSRF, SSTI, and command injection. The authors validate this experimentally with a case study (TicketOracle) showing SSRF susceptibility varies significantly across seven different LLMs.

Technical Analysis

The entry point is user-supplied text handled by an LLM that generates or influences backend actions (DB queries, HTTP requests, file paths, template strings, shell commands) without adequate sanitization at the trust boundary between model output and downstream sinks. Because the LLM does not inherently understand security context, it can be manipulated via prompt injection to produce outputs that, when passed unchecked into SQL interpreters, template engines, HTTP clients, or shell executors, trigger classical vulnerabilities (LLM2SQLi, LLM2SSRF, LLM2SSTI, etc.). This crosses the model/application boundary: the LLM is not the vulnerable component itself, but acts as a confused deputy carrying attacker influence from the prompt layer into privileged backend operations that trust model-generated content. The paper's experimental results (TicketOracle, 7 LLMs, 5 SSRF scenarios) demonstrate that model choice and application architecture jointly determine exploitability, indicating this is a systemic architectural risk rather than a single-model bug.

Affected Systems

Flask (case study), generic LLM-integrated tool-calling pipelines

Detection Signatures

  • Logs showing LLM-generated content directly interpolated into SQL queries, shell commands, URLs, or template strings without validation
  • Anomalous outbound HTTP requests to internal/metadata IP ranges (e.g., 169.254.169.254) originating from LLM tool-call outputs
  • Tool or agent responses containing unescaped special characters (quotes, angle brackets, template delimiters) that propagate into rendered output or backend calls
  • Repeated prompt patterns attempting to instruct the model to construct URLs, queries, or commands referencing internal resources

Remediation Steps

  1. 1

    Enforce output validation at trust boundaries

    Treat all LLM-generated or LLM-influenced content as untrusted user input before it reaches SQL, shell, template, XML, or HTTP sinks; apply parameterized queries, output encoding, and strict allow-lists.

  2. 2

    Sandbox and constrain tool capabilities

    Limit what backend actions an LLM-driven tool call can perform (e.g., restrict SSRF-prone HTTP clients to allow-listed domains, disable outbound requests to internal/link-local IP ranges).

  3. 3

    Apply prompt-layer defenses

    Use input/output filtering, instruction hierarchy enforcement, and injection-detection classifiers to reduce the likelihood that attacker input alters model-mediated actions.

  4. 4

    Model-aware risk assessment

    Since susceptibility varies by model, benchmark candidate LLMs against LLM2X-style test suites (e.g., SSRF/SQLi/SSTI scenarios) before deployment in tool-enabled pipelines.

  5. 5

    Apply defense-in-depth at network/application layers

    Use egress filtering, WAFs, template sandboxing, and least-privilege database/service accounts so that even a successful injection cannot escalate to full compromise.

Industries Most Exposed

software/SaaScustomer-support/helpdeske-commercefinancehealthcare

Sources

Respond to this threat

Pro subscribers get a full AI-generated incident-response playbook for this threat — detection, containment, eradication, and recovery steps — plus an unlimited AI Threat Advisor for questions about your environment.