The LogInject framework discloses passive prompt injection in LLM log analysis, with a baseline attack success rate of up to 88.2%Context Contamination in LLM Analysis of Network Security Logs: Poison with Passive Prompt Injection and Mitigation Evaluation
Translation in progress — untranslated text is omitted.
The researchers propose the LogInject framework to systematically evaluate passive prompt injection risks in LLM log analysis pipelines, where attackers write prompt injection payloads into log fields, the payloads lie dormant in storage, and are only retrieved and executed when an analyst queries the LLM. The study builds the LogInject-1.0 benchmark with 12,847 logs, including 2,569 adversarial samples, covering three formats: Apache access logs, SSH authentication logs, and JSON application logs, and tests GPT-4o, Llama-3-70B, and Claude 3.5 Sonnet across four objectives: activity hiding, false report generation, information exfiltration, and output hijacking. Under baseline conditions, attack success rate is up to 88.2%, with a cross-model average of 83.4%; the authors' proposed Context Stitching technique splits payloads across multiple logs to bypass stateless filtering, achieving a success rate of 76.4%.
- Modern SOCs use LLMs to analyze network logs, but external untrusted traffic can write prompt injection payloads into log fields. Because the attention mechanism cannot distinguish control instructions from data, retrieval and execution trigger context contamination, causing the model to conceal malicious activity or fabricate alerts.
- Proposes the LogInject evaluation framework and a three-level attack taxonomy (atomic injection, cross-log context stitching, and encoding obfuscation), and designs a three-layer defense-in-depth system combining input regex filtering, prompt Spotlighting, and output validation.
- Without defense, the three models achieve an average ASR of 83.4% (Table 6), with fragment stitching reaching 76.4% success rate. Three-layer combined defense reduces GPT-4o's ASR to 8.4% (Table 9), benign accuracy drops by 3.4 percentage points, and Spotlighting defense decays under long context.
- The authors note that the evaluation covers only three 2024 models and does not test small models or domain-fine-tuned models; the benchmark uses LogHub and synthetic data; the attacker is assumed to be one-way blind writing and adaptive attacks are not tested; GPT-4o initial screening has potential systematic bias.
The paper reports the attack success rate of passive prompt injection in log analysis scenarios and the residual risk of layered defenses, which can serve as a reference for teams deploying LLM-based log analysis.