testing-for-email-header-injection

Test web email endpoints for CRLF and newline SMTP header injection.

Updated Jan 29, 2024
One-click install
npx skills add https://github.com/riandeoliveira/aspnet-template --skill testing-for-email-header-injection-riandeoliveira
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-for-email-header-injection
Source: https://github.com/riandeoliveira/aspnet-template/tree/main/.claude/skills/testing-for-email-header-injection
Command: npx skills add https://github.com/riandeoliveira/aspnet-template --skill testing-for-email-header-injection-riandeoliveira

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, and includes scripts (resource) and references (resource) components.

What problem does it solve?

It helps you identify whether an application lets untrusted input break out of an email template and create new SMTP headers (such as Cc/Bcc/From), enabling spoofing or spam-relay abuse.

Core Features & Use Cases

  • Email header injection testing via form fields and encoded newline payloads to attempt CRLF/LF/CR injection.
  • Validation workflows that infer impact from HTTP responses and captured email output, then document injection point, encoding, and expected headers.
  • Targeted testing for common email-related scenarios such as contact forms, sharing/invite flows, password reset, and JSON email-sending APIs.

Quick Start

Run the agent against your authorized test URL and endpoint to generate a JSON report of suspected injection findings.

Frequently Asked Questions about testing-for-email-header-injection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test for CRLF email header injection in web application forms?

Email header injection occurs when untrusted user input breaks out of an email template using CRLF characters, allowing attackers to add unauthorized SMTP headers like Cc or Bcc for spam relay or spoofing. Testing requires submitting encoded newline payloads to vulnerable form fields.

What web application endpoints are vulnerable to SMTP header injection?

SMTP header injection commonly affects contact forms, sharing and invite flows, password reset endpoints, and JSON-based email-sending APIs where user input is directly reflected into outbound email headers without proper newline sanitization.

How do I automate email header injection testing for password reset flows?

Automate email header injection testing by providing a target base URL to an agent that systematically generates multiple newline encodings, submits HTTP POST requests to the endpoint, and outputs a JSON report of detected injection indicators.

Do I need Burp Suite to detect CRLF injection in email APIs?

Burp Suite is not required for detecting email header injection. You can test email APIs by using Python scripts with the requests library to submit encoded newline payloads and generate a JSON report of suspected injection findings.

What payload encodings work for detecting newline injection in SMTP headers?

Effective SMTP header injection testing uses systematic payload generation with multiple CRLF, LF, and CR newline encodings to bypass input filters and successfully break out of email template headers across different web server environments.

How do I validate if an email header injection payload was successful?

Validate email header injection success by inferring impact from HTTP responses and captured email output, then documenting the specific injection point, the newline encoding used, and the expected unauthorized headers added.