Skip to content
Glossary · Security

Email header injection

An attack on a web form or app that builds email from user input: injected line breaks add headers such as Bcc, turning the form into a spam relay.

What it means

Message headers are separated by line breaks. If an application places user input, such as a name, email address or subject, into a header without removing carriage returns and line feeds, an attacker can end the header early and add new ones: extra recipients through Cc or Bcc, a different From, or a new body. MITRE catalogues it as CAPEC-134, email injection.

The result is mail sent from your server and domain, signed and authenticated as yours, to whomever the attacker chooses. That damages domain and IP reputation and can get the server blocklisted.

Prevent it by rejecting or stripping CR and LF in any value used in a header, validating email addresses strictly, and using mail libraries that encode headers rather than concatenating strings.

Example

name=Alice%0d%0aBcc:%20victims@example.net

Sources

What this definition rests on. The wording is ours; the facts are theirs.

All 432 terms in the glossaryThe wiki: blocklists and bounce codes

Beat · paid monitoring

A heartbeat for your email.

Beat runs every check on this site on a schedule: 41 checks, 25 blacklists and real inbox placement. The moment something breaks, it tells you what broke, why it matters, and the exact fix.

example.comWatching
  • SPFpass
  • DKIMpass
  • DMARCp=none
  • Blacklists0 of 25

Illustrative. Your domain, every few hours.

Also from us:Pulse: your own sending infrastructureConsulting: $65/hr, no retainer