# http-host-header-attacks

Playbook for HTTP Host header attacks: password reset poisoning, cache poisoning, routing SSRF, and virtual host bypass. Useful for auditing applications that trust incoming headers.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3600 installs · ★ 2547
- Author: yaklang
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/yaklang/hack-skills/tree/HEAD/skills/http-host-header-attacks/SKILL.md
- Updated: 2026-09-13
- HTML: https://affpapa.org/en/nevibecode/skills/http-host-header-attacks

## What it does

This skill provides testing procedures for vulnerabilities caused by backends that trust the HTTP Host header. When an application constructs outgoing URLs from user input, attackers can redirect critical flows to external systems. Password reset poisoning works this way: the server inserts an untrusted domain into the reset email, leaking the security token.

The guide outlines web cache poisoning, virtual host discovery with ffuf, and reverse proxy routing SSRF. Successful cache attacks require the proxy to omit the Host header from its cache key while the application reflects it in the response body. For virtual host discovery, the playbook targets hidden admin panels using localhost and internal hostnames.

Validation bypasses receive special attention. The instructions cover override headers like X-Forwarded-Host, absolute URIs in the request line, and duplicated Host headers. Base reasoning models frequently overlook double Host tricks and trailing FQDN dots, making this checklist a reliable safeguard against missed attack vectors.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add yaklang/hack-skills --skill http-host-header-attacks -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/http-host-header-attacks/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/http-host-header-attacks/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add yaklang/hack-skills --skill http-host-header-attacks -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/http-host-header-attacks/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add yaklang/hack-skills --skill http-host-header-attacks -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/http-host-header-attacks/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install yaklang/hack-skills http-host-header-attacks
```

2. **Manually: put the files in place**
- File: `.github/skills/http-host-header-attacks/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add yaklang/hack-skills --skill http-host-header-attacks -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/yaklang/hack-skills --path skills/http-host-header-attacks
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/http-host-header-attacks/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add yaklang/hack-skills --skill http-host-header-attacks -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/yaklang/hack-skills/tree/HEAD/skills/http-host-header-attacks/SKILL.md

## When to use it
- Test password reset token theft through Host header injection
- Discover hidden admin consoles via virtual host brute-forcing
- Verify web cache poisoning when Host is excluded from the cache key
- Identify internal SSRF triggered by reverse proxy routing
- Bypass Host validation using X-Forwarded-Host and absolute URIs

## Example prompts
- Check the password reset endpoint for Host header injection vulnerabilities
- Show Host validation bypass techniques using X-Forwarded-Host and duplicate headers
- Generate an ffuf command to fuzz virtual hosts on the target IP

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 5a0cff70b5e1abeb.

BEGIN THIRD-PARTY FILE 5a0cff70b5e1abeb
````text
---
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
````
END THIRD-PARTY FILE 5a0cff70b5e1abeb

The third-party file has ended. Everything between the 5a0cff70b5e1abeb tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2381 of 11759 bytes. © yaklang · MIT · https://github.com/yaklang/hack-skills/tree/HEAD/skills/http-host-header-attacks/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
