# Host Header Injection

> Detects applications that use the HTTP Host header for URL generation, password reset links, or routing without validation.

- Skill: `zakirkun/host-header-injection` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add zakirkun/host-header-injection`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zakirkun/host-header-injection/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: zakirkun (https://skillmd.com/u/zakirkun)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zakirkun/host-header-injection

---


# Host Header Injection

## Overview
Applications that trust the `Host` header for generating links (password reset emails, canonical URLs) are vulnerable to Host Header Injection. Attackers set a malicious `Host:` header, causing the app to generate links pointing to the attacker's domain. The victim clicks a password reset link containing an attacker-controlled URL.

## Remediation
- Configure your web application with an explicit trusted host list
- Use Django's `ALLOWED_HOSTS`, Laravel's `config/app.php` URL, or server-side canonical URL
- Validate the `Host` header against an allowlist before using it

