HTML Injection

Detects user-controlled input reflected in HTML without proper encoding, enabling HTML injection that may not execute scripts but can redirect or spoof content.

zakirkun 4bd0c9a 2 files · 2.4 KB Updated

File contents

HTML Injection

Overview

HTML injection allows attackers to insert arbitrary HTML markup into web pages. Unlike XSS, HTML injection may not involve script execution (e.g., blocked by CSP) but can still:

  • Redirect users via injected <meta refresh>
  • Spoof content with injected forms (phishing)
  • Manipulate page structure to mislead users
  • In some contexts, escalate to XSS

Remediation

  • HTML-encode all user output: htmlspecialchars(), html.escape(), template.HTMLEscapeString()
  • Use auto-escaping template engines

zakirkun/ice-tea/tree/main/skills/injection/html-injection commit 4bd0c9a88a

Frequently asked questions

npx skillmds@latest add zakirkun/html-injection