Skip to content

Prompt injection attacks against LLM-integrated applicationsPrompt Injection attack against LLM-integrated Applications

arXiv· arXiv:2306.05499· Yi Liu, Gelei Deng, Yuekang Li, Kailong Wang, Zihao Wang, Xiaofeng Wang, Tianwei Zhang, Yepang Liu, Haoyu Wang, Yan Zheng, Leo Yu Zhang, Yang LiuGriffith University; Nanyang Technological University; University of New South Wales; Huazhong University of Science and Technology; Indiana University at Bloomington; Southern University of Science and Technology; Tianjin UniversityIndexed by this site · 25 days ago· Originally publishedSelected AttacksSelectedAttention42

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

The authors propose the black-box prompt injection method HOUYI, tested on 36 real LLM-integrated applications; the authors state that 31 can be injected, and 10 vendors confirmed.

Threat modelThe attacker interacts with the target application through public service endpoints and can arbitrarily manipulate input; the goal is to make the application output deviate from its intended function. Black-box scenario: the attacker cannot access the preset prompts, application structure, or backend LLM, and can only infer information from responses.

Questions
In LLM-integrated applications, malicious users can use prompt injection to override preset instructions, but existing heuristic injection methods mostly fail on real commercial applications, and the attack mechanisms lack systematic understanding.
Methods
The authors first conducted a pilot study on 10 applications to summarize the reasons for failure, then, drawing on SQL injection/XSS, proposed HOUYI: using an LLM to infer the application context, generating a three-part injection prompt consisting of framework, delimiter, and disruptor, and iteratively optimizing it with feedback.
Experiments and results
On 36 real applications, the authors state that 31 can be injected (86.1%), demonstrate two types of consequences, prompt leakage and prompt abuse, and 10 vendors confirmed; the authors also state that all six existing defenses can be bypassed by HOUYI.
Limitations and future work
The authors note: the delimiter strategy may only scratch the surface, and more techniques are worth exploring (Section 7.2); vulnerabilities may not be reproducible as applications evolve (Section 7.3). The experiments cover only the 36 applications of SUPERTOOLS, with each attack repeated 5 times.
Experimental setup36 个来自 SUPERTOOLS 的真实 LLM 集成应用 · 易受攻击应用数(5 种利用场景下 5 次尝试中的成功次数)
Benchmarks
36 个来自 SUPERTOOLS 的真实 LLM 集成应用
Metrics
易受攻击应用数(5 种利用场景下 5 次尝试中的成功次数)
AI summaryand selection rationaleThe researchers propose a black-box prompt injection attack method, HouYi; 31 of 36 real LLM-integrated applications were compromised, and the toolkit's attack success rate was 86.1%. The method first uses an LLM to infer the application's internal context based on application documentation and question-answer pairs, then generates an injection prompt assembled from a framework component that simulates normal interaction, a separator component that cuts off preset context, and a distractor component that carries the malicious objective, and iteratively adjusts based on returned results; separation strategies include escape characters, language switching and semantic generation. The researchers first tested existing attack techniques on 10 commercial applications, and only 2 partially succeeded, because these applications treat user input as data to be analyzed, impose format constraints on input and output, and use multi-step processes with time limits. 10 vendors confirmed these vulnerabilities, including Notion, Parea and WriteSonic; the paper states that leaked prompts can be used to replicate services at low cost and also to use vendors' model compute for free. Common defenses can mitigate traditional injection but still cannot block payloads generated by HouYi.

The researchers propose a black-box prompt injection attack method, HouYi; 31 of 36 real LLM-integrated applications were compromised, and the toolkit's attack success rate was 86.1%. The method first uses an LLM to infer the application's internal context based on application documentation and question-answer pairs, then generates an injection prompt assembled from a framework component that simulates normal interaction, a separator component that cuts off preset context, and a distractor component that carries the malicious objective, and iteratively adjusts based on returned results; separation strategies include escape characters, language switching and semantic generation. The researchers first tested existing attack techniques on 10 commercial applications, and only 2 partially succeeded, because these applications treat user input as data to be analyzed, impose format constraints on input and output, and use multi-step processes with time limits. 10 vendors confirmed these vulnerabilities, including Notion, Parea and WriteSonic; the paper states that leaked prompts can be used to replicate services at low cost and also to use vendors' model compute for free. Common defenses can mitigate traditional injection but still cannot block payloads generated by HouYi.

Why it was selectedThe paper first explains why existing attacks fail on commercial applications, then presents a reusable three-part injection construction and measured success rates.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Existing prompt injection methods mostly fail on real LLM-integrated applications; the authors aim to systematically understand the mechanism and propose an effective black-box attack.

    Core question: how to carry out effective black-box prompt injection attacks on real LLM-integrated applications, and understand why existing methods fail.

    • Problem setting: LLM-integrated applications embed user input into preset prompts and then hand them to the LLM; a malicious user can inject a prompt to override the original instructions; OWASP has listed this as the top LLM-related risk (Introduction).
    • Shortcomings of existing methods: the authors reproduced three classes of existing injection methods on 10 commercial applications, and only 2 applications partially succeeded (Table 1). Reasons for failure: the application treats user input as data rather than as a question, input/output format restrictions, and multi-step pipelines plus response time limits (Section 3.3).
    • Core observation: the authors hold that the key to successful injection is making the LLM interpret the malicious payload as a question rather than as data, drawing on the idea of "terminating the preceding syntax" from SQL injection/XSS (Section 4.1).
    • Paper output: proposes the black-box injection method HOUYI, implemented as a 2,150-line Python toolkit, evaluated on 36 real applications (Sections 4 and 6).
    • Threat model (Section 2.3):
      • Goal: force the application to produce output that deviates from its intended function.
      • Knowledge: black-box, with no access to the preset prompts, application structure, or backend LLM, and able to infer only from responses.
      • Capability: interact through public service endpoints and manipulate input arbitrarily.
      • Victim system: LLM-integrated applications; excludes scenarios such as front-end vulnerability exploitation or polluting external resources.
  2. What related research exists?

    Related work falls into three categories: direct prompt injection, indirect prompt injection, and traditional injection attacks; the authors state that this paper is the first systematic method.

    Direct prompt injection

    • Perez and Ribeiro [44]—proposed injection techniques such as context ignoring against GPT-3 and its applications, which can hijack the model's goal or leak the application's original prompt. The authors state that, compared with this, this paper systematically explores strategies and prompt patterns for triggering attacks, covering a broader range of real applications (Section 8.1).
    • Simon Willison [4], NCC Group [16]—described several vanilla injection attacks against standalone LLMs and LLM-integrated applications, which the authors summarize into three classes: direct injection, escape characters, and context ignoring (Section 3.1).
    • Apruzzese et al. [6]—discusses that real attackers do not perform gradient computation, and is an injection-related work cited by the authors (Section 2.2).

    Indirect prompt injection

    • Greshake et al. [20]—indirectly delivers malicious payloads to applications by polluting internet resources (web pages, emails), exploiting the user endpoint. The authors explicitly exclude this from the threat model of this paper (Section 2.3).

    Traditional injection attacks (source of methodological inspiration)

    • SQL injection [10, 14, 25] and XSS [23, 27, 63]—crafted payloads terminate the preceding syntax and cause malicious input to be interpreted as a new command; HOUYI's delimiter design draws on this idea (Section 4.1).

    Baselines and evaluation targets: the pilot study uses the three classes of injection methods from [4, 16, 44] as baselines, tested on 10 applications of SUPERTOOLS [3]; the ablation baselines are the three variants HOUYI-SYNTAX-ONLY, HOUYI-LANGUAGE-ONLY, and HOUYI-SEMANTIC-ONLY (Section 6.3).

    The authors state that this paper is the first work to adopt a systematic method for prompt injection against LLM-integrated applications, and propose generation strategies that improve the success rate (contribution list in Section 1).

  3. How does the paper address this problem?

    HOUYI uses an LLM to infer the application context, generates a three-part injection prompt, and then iteratively refines it based on feedback, all black-box.

    Overall approach: Drawing on SQL injection/XSS, the injection prompt is split into three components—framework, separator, and disruptor—generated with a custom LLM and iteratively refined based on application feedback. The method is named HOUYI, implemented as a 2150-line Python toolkit (Section 6).

    Design Insights

    • The pilot study finds: when user input is analyzed as "data", escape characters and context ignoring both fail to isolate malicious commands (Section 4).
    • The authors' key point: a separator component constructed based on the preceding context is needed so that the LLM interprets the following content as independent instructions (Section 4.1).

    Application Context Inference (Section 5.2)

    • Extract example questions from the target application's documentation and usage examples, feed them to the application and record input-output pairs, assembling a Q&A document.
    • Use a custom LLM to analyze this document from three angles: the application's core purpose, the nature of the questions asked, and whether inputs and outputs follow a specific format; the inference results are stored in natural language.

    Three-Component Generation (Sections 5.3–5.5)

    • Framework Component: A prompt that simulates normal interaction; selection principles are reproducibility (stably producing similar responses) and short answers (avoiding token limits and frontend timeouts); generated by a generative LLM (e.g., GPT-3.5) according to a guiding prompt.
    • Separator Component: Three types of strategies—Syntax-based (syntax such as escape characters), Language Switching (framework and separator in one language, disruptor in another), Semantic-based (reasoning summary, explicit ignoring, appended task); the application context and strategy guiding prompt are fed to a generative LLM to obtain the separator (Table 2 gives examples of each strategy).
    • Disruptor Component: The question carrying the malicious intent; two techniques are aligning with the application's original output format and limiting output length (the paper's example is within 20 words; long answers can be obtained through multiple attacks).

    Feedback Iterative Refinement (Section 5.6, Algorithm 1)

    • Initially use the simplest strategy: empty framework, empty separator, and a PoC question with a known answer as the disruptor.
    • On failure, change the framework (randomly selected from verified example inputs) and enumerate new separator strategies to regenerate; on success, keep the framework and separator and change the disruptor to cover other malicious intents.
    • Use a custom LLM (e.g., GPT-3.5) to evaluate the relevance of the response to the malicious intent and format alignment, looping until a successful prompt set is produced.

    Success Judgment (Section 6.1)

    • An application is judged vulnerable if: the injection can be effectively executed; server errors caused by the injection do not count as success.
    • Design 5 exploitation scenario queries (PROMPT LEAKING, CODE GENERATION, CONTENT MANIPULATION, SPAM GENERATION, INFORMATION GATHERING, Table 3), each executed 5 times, with each result manually verified.
  4. What experiments did the paper conduct?

    31 of 36 real applications were injected; the ablation shows full HOUYI detects the most; the authors state that all six defenses can be bypassed.

    Experimental Setup

    • Subjects tested: 36 real LLM-integrated applications from SUPERTOOLS (10 in the pilot study + 26 newly added), with selection criteria of being accessible and having an integrated LLM; only Notion, PAREA, and WRITESONIC are named with vendor permission, the rest are anonymized (Table 4, Appendix Table 5).
    • Auxiliary model: GPT3.5-turbo is used for feedback inference (Section 5.6) and framework component generation (Section 5.3), with temperature and top_p both set to 1 (Section 6.1).
    • Baselines: The pilot study uses three types of injection methods from [4, 16, 44]; ablations use HOUYI-SYNTAX-ONLY, HOUYI-LANGUAGE-ONLY, HOUYI-SEMANTIC-ONLY.
    • Metrics and judgment: 5 exploitation scenarios (Table 3) are each executed 5 times, recording the number of successes; at the application level, at least one success means vulnerable; all results are manually verified.
    • Number of repetitions: Each exploitation prompt is executed 5 times; ablation evaluation is executed 5 times per application.

    Main Results

    According to Table 4 (each cell is the number of successes out of 5 attempts for that scenario, "-" means not applicable):

    Swipe horizontally to read the table

    ApplicationPLCGCMSGIG
    AI WITH UI5/55/55/55/55/5
    NOTION5/55/55/55/55/5
    DECISIONAI5/55/55/51/51/5
    MINDAI5/55/55/51/51/5
    ENGAGEAI3/54/52/53/54/5
    TRIPPLAN-2/53/52/53/5
    GAMLEARN and 5 others-----
    • Of the 36 applications, 31 are successfully injected in at least one scenario, and the authors report an overall success rate of 86.1% (Abstract and Section 6.2).
    • The authors' explanations for failure cases: STORYCRAFT, STARTGEN, and COPYBOT use domain-specific LLMs; GAMLEARN has many internal processing steps; MINDGUIDE is a multimodal combination (Section 6.2).
    • The authors believe the reasons for low success rates in some scenarios include unstable LLM outputs, improper application error handling (e.g., ENGAGEAI and TRIPPLAN directly echo GPT API overload errors), and output length and format restrictions (Section 6.2).

    Ablation Study (RQ4, Section 6.3)

    • What was tested: How many vulnerable applications each of the three separator strategies can detect when used alone, presented as a Venn diagram in Figure 5.
    • Results: The figure shows that the full HOUYI detects 13, SEMANTIC-ONLY 7, LANGUAGE-ONLY 6, and SYNTAX-ONLY 4 (including intersection region numbers 0, 1); the authors state that full HOUYI outperforms the three ablation variants.
    • Authors' interpretation: SYNTAX-ONLY performs worst; SEMANTIC-ONLY performs relatively well by leveraging LLM capabilities; LANGUAGE-ONLY, though not the best, detects one application that the other variants fail to cover.

    Vulnerability Verification (RQ5, Section 6.4)

    • Vendor confirmation: 10 of the 31 vulnerabilities are confirmed by vendors, including Notion, which serves over 20 million users (Section 6.4).
    • Case 1 (WRITESONIC prompt leaking): A language-switching strategy is used to leak its internal prompt; the authors build an imitation application with the leaked prompt and observe similar responses; the WRITESONIC developer confirms the leak and its impact (Section 6.4.1).
    • Case 2 (PAREA prompt abuse): After appending a semantic separator, custom commands can be executed; the authors estimate a developer daily loss of $259.2 based on 90k tokens/minute, $0.002/1k tokens (GPT3.5-turbo), and 1440 minutes, and state that the other 30 applications are similarly vulnerable to similar abuse; the PAREA developer confirms (Section 6.4.2).

    Defense Evaluation (Section 7.1)

    • What was tested: Six empirical defenses are implemented and evaluated with HOUYI—Instruction Defense, Post-Prompting, Random Sequence Enclosure, Sandwich Defense, XML Tagging, Separate LLM Evaluation.
    • Results: The authors state that, after manual inspection, HOUYI can effectively bypass these defenses; the paper does not report quantitative success rates for each defense.

    Other Ablations and Analyses

    • Pilot study (Table 1): For the three existing methods on 10 applications, only two chatbot applications have Q1/Q2 fully successful (5/5 each), context ignoring on AI WITH UI has Q1 success 4/5, and the rest all fail.
    • The authors point out that the "success" evidence on chatbots in the pilot study is weak: answering user queries is their intended function; the output of AI WITH UI is an HTML fragment containing the target phrase (Section 3.2.1).
  5. What are some points that can be further explored?

    The authors note that the delimiter strategy may be extensible and that vulnerabilities may not be reproducible; the experiments cover 36 applications, with each attack repeated 5 times.

    Limitations and Future Directions Pointed Out by the Authors

    • The three separator generation strategies come from the pilot study; the authors believe they may only scratch the surface of potential methods, and future work could explore more efficient injection techniques (Section 7.2).
    • As applications evolve rapidly (deploying defense systems, updating backend LLMs), discovered vulnerabilities may become non-reproducible over time; the authors plan to continuously monitor the reproducibility of attack methods (Section 7.3).
    • The authors state that the existing six defenses cannot resist all injection forms and that more advanced protection mechanisms are needed (Section 7.1).

    Scope of Experimental Coverage

    • The subjects tested are 36 real LLM-integrated applications on SUPERTOOLS, of which 31 are judged vulnerable and 10 are confirmed by vendors (Table 4).
    • There are 5 exploitation scenarios (Table 3), each executed 5 times per application, with results manually verified (Section 6.1).
    • The defense evaluation covers 6 empirical defenses; conclusions come from manual inspection, and the paper does not report quantitative success rates (Section 7.1).
    • The auxiliary model is only GPT3.5-turbo (default parameters); the backend LLMs of the target applications are mostly undisclosed, and the paper does not specify the model used by each application one by one (Section 6.1).
    • The paper does not report the upper limit on attack iterations, the total number of queries, or the time consumed.
  6. Summarize the main content of the paper

    HOUYI achieves black-box injection with a three-part prompt structure; 31 of 36 real applications are compromised, and 10 vendors confirm.

    A study of prompt injection attacks against LLM-integrated applications, proposing the black-box method HOUYI and conducting a large-scale real-world evaluation.

    • Problem: existing heuristic prompt injections mostly fail on real commercial applications—the authors reproduced three classes of methods on 10 applications, and only 2 partially succeeded (Table 1); reasons include input being treated as data, format restrictions, and multi-step time limits.
    • Method: drawing on SQL injection/XSS, HOUYI splits the injection prompt into three components: framework, delimiter, and disruptor; it uses an LLM to infer the application context and then generates each component, and iteratively refines them according to application feedback (Algorithm 1).
    • Main result: of 36 real applications, 31 were successfully injected in at least one exploitation scenario, with the authors reporting a success rate of 86.1% (Table 4).
    • Ablation: Figure 5 shows that full HOUYI detects 13 vulnerable applications, more than SEMANTIC-ONLY (7), LANGUAGE-ONLY (6), and SYNTAX-ONLY (4).
    • Consequence validation: demonstrates WRITESONIC prompt leakage (confirmed by the vendor) and PAREA prompt abuse (the authors estimate a daily loss of $259.2); 10 vendors confirmed the vulnerabilities, including Notion, which has over 20 million users.
    • Defenses: the authors state that six existing empirical defenses can all be bypassed by HOUYI (manual inspection, no quantitative data).
    • Authors' conclusion: prompt injection poses a real risk to LLM-integrated applications and requires more systematic defense research; the authors made responsible disclosure and limited experiments to avoid actual harm.
Read originalarxiv.org