Decoding Latent Attack Surfaces in LLMs: Prompt Injection via HTML in Web Summarization

Ishaan Verma, Arsheya Yadav
9/6/2025
cs.CRcs.AI

No official code found. Best implementation: ishaanv1709/Decoding-Latent-Attack-Surfaces-in-LLMs-Prompt-Injection-via-HTML-in-Web-Summarization (1 star, CC0-1.0, last commit 2025-08-03).

Abstract

Large Language Models (LLMs) are increasingly integrated into web-based systems for content summarization, yet their susceptibility to prompt injection attacks remains a pressing concern. In this study, we explore how non-visible HTML elements such as <meta>, aria-label, and alt attributes can be exploited to embed adversarial instructions without altering the visible content of a webpage. We introduce a novel dataset comprising 280 static web pages, evenly divided between clean and adversarial injected versions, crafted using diverse HTML-based strategies. These pages are processed through a browser automation pipeline to extract both raw HTML and rendered text, closely mimicking real-world LLM deployment scenarios. We evaluate two state-of-the-art open-source models, Llama 4 Scout (Meta) and Gemma 9B IT (Google), on their ability to summarize this content. Using both lexical (ROUGE-L) and semantic (SBERT cosine similarity) metrics, along with manual annotations, we assess the impact of these covert injections. Our findings reveal that over 29% of injected samples led to noticeable changes in the Llama 4 Scout summaries, while Gemma 9B IT showed a lower, yet non-trivial, success rate of 15%. These results highlight a critical and largely overlooked vulnerability in LLM driven web pipelines, where hidden adversarial content can subtly manipulate model outputs. Our work offers a reproducible framework and benchmark for evaluating HTML-based prompt injection and underscores the urgent need for robust mitigation strategies in LLM applications involving web content.

View on arXivView PDF

Code Implementations(1)

CC0-1.0

Official GitHub Repository for the paper "Decoding Latent Attack Surfaces in LLMs: Prompt Injection via HTML in Web Summarization"

10HTML, PythonJul 3, 20251 years agoCC0-1.0
cybersecurityhtmlllmsprompt-injectionresearch-paper

Similar Papers

Cite this paper

@article{verma2025decoding,
  title  = {Decoding Latent Attack Surfaces in LLMs: Prompt Injection via HTML in Web Summarization},
  author = {Ishaan Verma and Arsheya Yadav},
  year   = {2025},
  eprint = {2509.05831},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.05831v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2509.05831.svg)](https://codeofpaper.com/paper/2509.05831)

Discussion