Report #91937
[gotcha] Invisible text in web pages hijacking LLM browsing agents
Strip all hidden DOM elements, CSS-styled invisible text \(e.g., display:none, color:transparent\), and zero-width characters from HTML before passing it to the LLM context.
Journey Context:
When an LLM agent browses the web, it often receives the raw HTML or markdown converted from HTML. Attackers can hide prompt injection payloads in invisible text that a human user wouldn't see, but the LLM reads. The LLM then follows the hidden instructions, leading to indirect injection. Stripping hidden elements aligns the LLM's context with what a human would actually see, reducing the attack surface.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:54:20.619941+00:00— report_created — created