CCyberwiki

Email spoofing

Email spoofing
ClassAvailability and abuse
MITRE ATT&CKT1684.002 Social Engineering: Email Spoofing, tactic Stealth
Typical severityMedium
AffectsDomains that publish no SPF, DKIM or DMARC record, or a DMARC policy of p=none

A message with From: billing@example.com in its header can come from any mail server on the internet. Email spoofing is sending mail whose sender address names a domain the sender does not control, so that it appears to come from that domain's owner. The attacker sets header values such as From, and mail clients show that value as the sender. Spoofing disguises social engineering attempts, Phishing among them.1

Description

Internet mail carries no built-in proof of who sent a message. RFC 7208 states that any host that injects mail "can use any DNS domain name it wants" in the sender fields defined by the mail standards.2 A message has two sender identities. The envelope sender is given to the receiving server in the SMTP MAIL FROM command. The From header sits inside the message, and it is the address the reader sees; the DMARC standard calls its domain the Author Domain.3

A receiving server can test a domain's claims only against records that the domain publishes in DNS: SPF, DKIM and DMARC, together described in Email authentication (SPF, DKIM and DMARC). Attackers pick domains whose DMARC policy is weak or absent.1

Mechanism

The domain example.com has an SPF record and no DMARC record. An attacker runs a mail server for mailer.example.net, a domain the attacker owns, and sends:

MAIL FROM:<bounce@mailer.example.net>
...
From: "Example Billing" <billing@example.com>
Subject: Your invoice

SPF checks the MAIL FROM and HELO identities only.2 The receiver looks up SPF for mailer.example.net, which the attacker controls, and the check passes. A DKIM signature on the message, if present, carries the attacker's domain in its d= tag. Neither protocol ties its result to the From domain.3 With no DMARC record at example.com, the receiver has no instruction to compare the authenticated domain with the visible one.

DMARC closes that gap. A message passes DMARC only when SPF or DKIM passes for a domain that is aligned with the Author Domain. Relaxed alignment requires the same organizational domain, so mail.example.com aligns with example.com; strict alignment requires identical names. The policy is a TXT record at _dmarc.example.com, and its p tag states how the domain owner wants failing mail handled.3

Table 1. DMARC policy values in RFC 9989
ValueMeaning given by the standard
p=noneNo handling preference; failing mail is delivered as usual. Used while reading reports.
p=quarantineFailing mail is to be treated as suspicious.
p=rejectA failure indicates that the use of the domain is not valid.

With quarantine or reject, failing mail does not reach the inbox at receivers that take part in DMARC and follow the owner's preference. Receivers may also choose not to follow it.3

Limits of the defences

DMARC leaves out look-alike domain names and the display name shown beside the address in the From header.3 A message from "Example Billing" <billing@examp1e.net> can pass every check, because the attacker controls the records of examp1e.net.

Forwarding breaks some checks. Almost all mailing lists rewrite the MAIL FROM identity, so SPF no longer matches the original domain.2 Relays that leave the content unchanged keep the DKIM signature valid.4 Under p=reject, legitimate mail that passes through mailing lists and forwarders can then be refused, and RFC 9989 asks domains whose users post to lists to study their aggregate reports before they set it.3

Notable incidents

On 2 May 2024 the NSA, the FBI and the US Department of State published a joint advisory, "North Korean Actors Exploit Weak DMARC Security Policies to Mask Spearphishing Efforts". It described mail made to appear to come from journalists, academics and experts in East Asian affairs, used to gain access to targets' documents, research and communications.5 SecurityWeek named the group as Kimsuky and reported that the messages were sent from addresses the group controlled, with misconfigured DMARC policies on the impersonated domains letting them through.6 The weak policy at issue looks like v=DMARC1; p=none; fo=1;, which asks receivers to deliver failing mail as usual.1

Detection

A domain's exposure shows in three DNS TXT lookups: the SPF record at the domain itself, the DMARC record at _dmarc. plus the domain, and each DKIM public key at <selector>._domainkey. plus the domain, where the selector is the s= value in a signed message.4 An SPF record that ends in ?all returns neutral and one that ends in ~all returns softfail, a weak statement that the host is probably not authorized; only -all lets a receiver conclude that an unlisted host is not allowed. Two SPF records at one name, or more than 10 terms that cause DNS lookups (include, a, mx, ptr, exists, redirect), make the result a permanent error.2

In mail already received, the message headers and server logs show failed SPF, DKIM or DMARC results and return paths that do not match the sender.1 DMARC aggregate reports, sent to the addresses in the rua tag, describe the mail that receivers saw using the domain3 and show senders that may be impersonating it.7

Prevention

Every service that sends mail as the domain needs to be authorized: the mail host, the transactional mail provider, the newsletter tool and, in a Supabase project, the custom SMTP service for sign-in mail, which needs DKIM, DMARC and SPF set up with that provider.8

  1. Publish one SPF record that lists each sending service and ends in -all, keeping lookups at 10 or fewer. A domain that sends no mail can publish v=spf1 -all.2
  2. Turn on DKIM at each provider and publish the public key it gives at the selector name. Google requires a key of at least 1024 bits for mail to personal Gmail accounts and recommends 2048.7
  3. Publish a DMARC record in monitoring mode with a report address:3
_dmarc.example.com  TXT  "v=DMARC1; p=none; rua=mailto:dmarc-feedback@example.com"

Once the reports show only known senders passing, change p=none to p=quarantine and then to p=reject. RFC 9989 removed the older pct tag, which applied a policy to a share of messages.3 Since 1 February 2024 Google has required SPF, DKIM and a DMARC record from senders of more than 5,000 messages a day to Gmail, with the From domain aligned to the SPF or DKIM domain; mail that fails may be rejected with error 5.7.26.7

Prompt for a coding agent

List every service in this project that sends email using our domain: auth or sign-up mail (for example Supabase custom SMTP), transactional mail, newsletters and support tools. For each, find in its official documentation the SPF include value, the DKIM records it asks for and whether it signs with our domain. Then draft one SPF record that ends in -all and stays at 10 or fewer DNS lookups, the DKIM records, and a DMARC record at _dmarc with p=none and a rua report address. Do not change DNS yourself; give me the records as a table with name, type and value, and note any service you could not confirm.

In SecFlash

On the Email and domain page, SecFlash reports a missing SPF record as SF-EML-101, a missing DMARC record as SF-EML-102 and a DMARC policy of p=none as SF-EML-103. SPF records that allow any server, end without an all rule or end in ?all are SF-EML-104, SF-EML-105 and SF-EML-106; two SPF records are SF-EML-107 and more than 10 lookups SF-EML-108. SF-EML-109 reports that no DKIM key was found and SF-EML-110 a DMARC record without a rua address. Registered look-alike domains, which DMARC does not cover, are SF-EML-202.

See also

References

  1. a b c d MITRE (created 14 April 2026, modified 3 November 2026). "Social Engineering: Email Spoofing, Sub-technique T1684.002". MITRE ATT&CK. Version 1.0.
  2. a b c d e Kitterman, S. (April 2014). "RFC 7208: Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1". RFC Editor. IETF.
  3. a b c d e f g h i Herr, T. and Levine, J., eds. (May 2026). "RFC 9989: Domain-based Message Authentication, Reporting, and Conformance (DMARC)". RFC Editor. IETF.
  4. a b Crocker, D., Hansen, T. and Kucherawy, M., eds. (September 2011). "RFC 6376: DomainKeys Identified Mail (DKIM) Signatures". RFC Editor. IETF.
  5. back National Security Agency (2 May 2024). "NSA Highlights Mitigations against North Korean Actor Email Policy Exploitation". NSA Press Room.
  6. back SecurityWeek (May 2024). "US Says North Korean Hackers Exploiting Weak DMARC Settings". SecurityWeek.
  7. a b c "Email sender guidelines". Google Workspace Admin Help. Google.
  8. back "Send emails with custom SMTP". Supabase Docs.