arXiv:2509.05831cs.CRcs.AI2025-09

隐藏HTML标签可诱骗大模型生成恶意摘要,暴露网页摘要系统漏洞

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

  • 用<meta>等不可见标签嵌入攻击指令,不改变页面可见内容
  • Llama 4 Scout有29%的摘要被误导,Gemma 9B IT也有15%成功率
  • 提供可复现的测试框架,适合关注LLM安全的开发者和研究者

大型语言模型(LLMs)越来越多地用于基于网页的内容摘要,但其易受提示注入攻击的问题仍令人担忧。本研究探讨了如何利用< meta>、aria-label和alt等不可见的HTML元素,在不改变网页可见内容的前提下,嵌入对抗性指令。我们构建了一个包含280个静态网页的新数据集,分为清洁版和注入攻击版,采用多种基于HTML的策略生成。通过浏览器自动化管道提取原始HTML和渲染文本,模拟真实世界中LLM部署场景。评估了两个最先进的开源模型:Llama 4 Scout(Meta)和Gemma 9B IT(Google),使用词法(ROUGE-L)与语义(SBERT余弦相似度)指标,结合人工标注,分析隐蔽注入的影响。结果表明,超过29%的注入样本导致Llama 4 Scout的摘要发生显著变化,而Gemma 9B IT也表现出15%的非微小成功率。这揭示了在基于网页的LLM流程中一个关键且被忽视的漏洞:隐藏的对抗内容可悄然操控模型输出。本工作提供了可复现的评估框架与基准,强调了在涉及网页内容的LLM应用中亟需加强防御措施。

原文摘要 · Abstract (English)

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.

LLM安全提示注入网页摘要HTML漏洞

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。