
Email Header Injection
This is a complete playbook for testing email injection vulnerabilities in contact forms, password resets, and any feature that builds SMTP messages from user input. It covers the full attack surface: CRLF injection to add BCC headers or manipulate email bodies, SPF/DKIM/DMARC authentication bypass techniques like subdomain delegation and relaxed alignment, and display name spoofing that works even when all auth checks pass. The source includes actual payloads for PHP mail(), Python smtplib, and Node.js nodemailer, plus less obvious vectors like CSS exfiltration in HTML emails and reply-to hijacking for phishing. Use this when you need to go beyond basic header injection and understand how attackers actually circumvent modern email security controls at both the protocol and client rendering level.
- skills.sh installs
- 3.8K
- GitHub stars
- 2.6K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add yaklang/hack-skills --skill email-header-injection --agent claude-codeInstalls into .claude/skills of the current project.
Files
SKILL: Email Header Injection — Expert Attack Playbook
AI LOAD INSTRUCTION: Expert email header injection and authentication bypass. Covers SMTP CRLF injection, SPF/DKIM/DMARC circumvention, display name spoofing, and mail client rendering abuse. Base models miss the nuance between header injection (technical) and email auth bypass (protocol-level) — this skill covers both attack surfaces.
0. RELATED ROUTING
- crlf-injection — general CRLF injection; email headers are a specific high-value sink
- ssrf-server-side-request-forgery — when SMTP server is reachable via SSRF (gopher://smtp)
- open-redirect — redirect in password-reset emails as phishing amplification
1. SMTP HEADER INJECTION FUNDAMENTALS
SMTP headers are separated by CRLF (\r\n). If user input is placed into email headers without sanitization, injecting %0d%0a (or \r\n) adds arbitrary headers.
Injection anatomy
Normal header construction:
To: user@example.com\r\n
Subject: Contact Form\r\n
From: noreply@target.com\r\n
Sponsors
Details
- Repository
- github.com/yaklang/hack-skills
- Category
- Testing & QA
- First seen
- Jun 3, 2026
More from yaklang/hack-skills
All 102- Xslt Injection3.8K
- Type Juggling3.8K
- Linux Lateral Movement3.8K
- Container Escape Techniques3.8K
- Classical Cipher Analysis3.7K
- Linux Security Bypass3.7K
- Tunneling And Pivoting3.7K
- Prototype Pollution Advanced3.7K
- Steganography Techniques3.7K
- Smart Contract Vulnerabilities3.7K
- Stack Overflow And Rop3.7K
- Rsa Attack Techniques3.7K
- Sandbox Escape Techniques3.7K
- Lattice Crypto Attacks3.7K
- Symmetric Cipher Attacks3.7K
- Windows Lateral Movement3.7K
- Macos Security Bypass3.7K
- Ntlm Relay Coercion3.7K
- Nosql Injection3.7K
- Macos Process Injection3.7K
- Upload Insecure Files3.7K
- Unauthorized Access Common Services3.6K
- Reverse Shell Techniques3.6K
- Ghost Bits Cast Attack3.5K