Into the Inbox: Novel Email Spoofing Attack Patterns
This talk demonstrates three novel email spoofing attack patterns that exploit misconfigurations in SPF, DKIM, and DMARC implementations across major email service providers. The research highlights how attackers can leverage master SPF records, feedback loops, and SMTP smuggling to bypass authentication mechanisms and deliver spoofed emails to target inboxes. The speakers provide a methodology for identifying vulnerable domains and offer actionable recommendations for organizations to harden their email security posture. The presentation includes a demonstration of these techniques and discusses the disclosure process for the associated vulnerabilities.
Bypassing DMARC and SPF: How Misconfigured Email Gateways Enable Spoofing
TLDR: Researchers at Black Hat 2024 demonstrated three novel email spoofing techniques that exploit misconfigurations in SPF, DKIM, and DMARC. By leveraging master SPF records, feedback loops, and SMTP smuggling, attackers can bypass authentication mechanisms to deliver spoofed emails from high-reputation domains. Pentesters should audit client email gateway configurations for these specific patterns to identify potential gaps in their security posture.
Email security is often treated as a solved problem. We rely on the trifecta of SPF, DKIM, and DMARC to verify sender identity, assuming that if these records pass, the email is legitimate. However, recent research presented at Black Hat 2024 proves that this assumption is dangerous. Attackers are not breaking the protocols themselves; they are exploiting the way email service providers and gateways implement them. If you are performing a red team engagement or a bug bounty hunt, you need to stop looking at whether a domain has DMARC enabled and start looking at how it is configured.
The Master SPF Record Trap
The first attack pattern targets the "master SPF record" misconfiguration. Many large web hosting providers and email services maintain a single, massive SPF record that includes IP ranges for all their customers. This is done for administrative convenience, allowing them to move customers between servers without forcing them to update their individual DNS records.
The vulnerability arises when an attacker registers an account with the same hosting provider. Because the provider’s master SPF record is overly permissive, an attacker can send an email from their own account using the provider’s infrastructure. Since the provider’s IP address is included in the master SPF record, the target’s email gateway sees a valid SPF pass. If the domain lacks a strict DMARC policy, the email lands in the inbox.
To test this, you need to enumerate the SPF records of a target domain. If you see an include statement pointing to a third-party hosting provider, check that provider’s SPF record. If it contains a broad IP range, you have a potential entry point. You can verify this by registering a trial account with that provider and attempting to send an email spoofing the target domain.
Exploiting Feedback Loops
The second technique involves abusing Feedback Loops (FBL). Many email service providers allow senders to receive reports when recipients mark their emails as spam. To prevent spoofing of these reports, providers require the email to be signed with DKIM.
The flaw is that many providers do not verify that the sender actually owns the domain they are claiming to be. They simply check if the email is signed with a valid DKIM key. If an attacker can send an email through a provider that supports FBL, they can sign the email with their own DKIM key. The receiving gateway sees a valid DKIM signature and a passing SPF check, leading to a DMARC pass.
This is a classic case of OWASP A07:2021 – Identification and Authentication Failures. During an engagement, look for headers like X-Feedback-ID. If you can identify a provider that signs emails without strict domain ownership verification, you can effectively spoof any domain that uses that provider for their FBL infrastructure.
SMTP Smuggling
The most sophisticated technique discussed is SMTP Smuggling, which exploits the difference in how outbound and inbound SMTP servers interpret the end-of-data sequence. The standard end-of-data sequence is <CR><LF>.<CR><LF>. However, some servers are configured to accept variations, such as <LF>.<LF> or <CR>.<CR>.
An attacker can craft a payload that includes these alternative sequences to "smuggle" a second, spoofed email inside the body of a legitimate one. When the outbound server processes the message, it sees one email. When the inbound, vulnerable server processes it, it interprets the smuggled sequence as the end of the first message and the start of a second, independent message. This allows an attacker to inject arbitrary commands and headers, effectively bypassing authentication checks entirely.
This technique is particularly dangerous because it exploits the fundamental parsing logic of SMTP servers. You can test for this by sending a crafted message to a server you control and observing how it is parsed. If the server splits your single message into two, it is vulnerable.
Defensive Recommendations
Defending against these attacks requires moving beyond basic record implementation. Organizations must ensure their DMARC policy is set to p=reject to prevent spoofed emails from reaching the inbox. Furthermore, email gateways should be configured to strictly enforce RFC 5322 standards, specifically regarding the From header and the end-of-data sequence.
For pentesters, the takeaway is clear: do not trust the "Pass" status in an email header. Always inspect the underlying SPF, DKIM, and DMARC configuration to see if the domain is relying on shared infrastructure or permissive records. The vulnerabilities identified in CVE-2024-7208 and CVE-2024-7209 serve as a reminder that even the most standard protocols can be subverted when implementation details are ignored. Start by auditing the SPF include chains of your targets; you will likely find more than a few that are wider than they should be.
Vulnerability Classes
OWASP Categories
Up Next From This Conference
Similar Talks

Unmasking the Snitch Puck: The Creepy IoT Surveillance Tech in the School Bathroom

Anyone Can Hack IoT: A Beginner's Guide to Hacking Your First IoT Device




