Suped

Does DKIM protect against replay attacks?

Michael Ko profile picture
Michael Ko
Co-founder & CEO, Suped
Published 14 Nov 2024
Updated 4 Oct 2025
7 min read
An illustration depicting a broken email seal, symbolizing a DKIM replay attack.
Email authentication protocols are foundational for securing digital communication. Among them, DomainKeys Identified Mail (DKIM) plays a crucial role in verifying the sender's identity and ensuring that emails haven't been tampered with during transit. It acts like a digital signature, allowing receiving mail servers to check if an email truly originated from the claimed domain and if its content remained unaltered.
However, the landscape of email threats is constantly evolving. While DKIM is effective against certain types of spoofing and content modification, a specific vulnerability known as a DKIM replay attack has raised questions about its comprehensive protection. This attack involves an adversary capturing a legitimate, DKIM-signed email and resending it to a different recipient, often to facilitate phishing or other malicious activities.
This article delves into the specifics of DKIM replay attacks, explaining why DKIM alone doesn't prevent them and outlining the essential measures needed to safeguard your domain and recipients from these sophisticated threats.

Understanding DKIM replay attacks

A DKIM replay attack occurs when an attacker intercepts a legitimate, DKIM-signed email and then re-sends that exact email, or a slightly modified version that doesn't invalidate the signature, to a new, unintended recipient. Because the original email was properly signed and the signature remains valid, the replayed email can pass DKIM authentication checks at the recipient's mail server.
The core issue is that DKIM verifies the email's integrity and sender identity at the time of sending, but it doesn't inherently include mechanisms to prevent an email from being resent later. Attackers exploit this by capturing emails that contain sensitive information or links (like password reset requests or OAuth alerts) and then replaying them to impersonate the legitimate sender, often targeting other users or internal systems. This can be particularly dangerous when the original email contains generic, reusable links or tokens. More details on how attackers exploit this vulnerability can be found in this analysis of DKIM replay attacks.
While DKIM helps confirm that an email's content wasn't altered in transit, it doesn't inherently add a temporal element or a unique, single-use identifier that would prevent its replay. This is where other authentication and policy mechanisms become essential.

The DKIM replay vulnerability

DKIM's primary function is to assure the recipient that the email was sent by the authenticated domain and that the message has not been modified since it left the original sender. It achieves this through cryptographic signing of certain email headers and the body. However, DKIM does not inherently prevent a legitimate, signed email from being intercepted and resent (replayed) by an unauthorized party. The signature itself, once valid, remains valid as long as the signed parts of the message are unchanged, regardless of when or by whom it's re-sent. This leaves a gap that sophisticated attackers can exploit.

How DKIM functions and its limitations

DKIM works by allowing an organization to cryptographically sign outgoing emails. This signature is then verified by the receiving mail server using a public key published in the sender's DNS records. If the signature matches, it confirms that the email has not been tampered with and that the sender is authorized to send emails from that domain. This capability helps ensure that DKIM prevents email modification in transit and verifies sender identity verification.
The limitations arise because DKIM is not designed to prevent an email from being re-sent. The signed email's validity is based on the cryptographic signature, not on a one-time use token or an expiration timestamp embedded within the signature itself (though some implementations might add expiration, it's not a core, universal part of the DKIM standard that would prevent all replays). Therefore, if an attacker gets hold of a validly signed email, they can replay the DKIM authenticated message to another recipient, potentially leading to successful phishing or credential theft.
This highlights that while DKIM is an indispensable part of email security, it must be combined with other protocols and best practices to offer truly comprehensive protection against modern threats. For instance, DMARC works alongside SPF and DKIM to provide a stronger defense.

DKIM's intended protection

  1. Sender authentication: Verifies that the email originates from the claimed domain, reducing direct email spoofing attempts.
  2. Message integrity: Ensures the email content (headers and body) has not been altered since it was signed.
  3. Anti-tampering: Detects any unauthorized changes made to the email's signed parts in transit.

DKIM's limitations against replay

  1. Lack of temporal validation: DKIM doesn't inherently check if an email is current or if it's being re-sent after its original purpose.
  2. Signature longevity: A valid signature remains valid for a potentially long period, allowing for replay attacks long after the initial send.
  3. No replay detection: DKIM itself has no built-in mechanism to identify or block emails that have been previously sent and are now being replayed.

Mitigation strategies for replay attacks

The most effective way to protect against DKIM replay attacks is through a layered approach to email security, with DMARC (Domain-based Message Authentication, Reporting, and Conformance) at its core. DMARC instructs receiving mail servers on how to handle emails that fail SPF or DKIM authentication, including those that are replayed. By enforcing a DMARC policy, organizations can prevent replayed emails from reaching recipient inboxes.
An illustration of a digital shield blocking replay attacks, symbolizing email security measures.
To effectively mitigate DKIM replay attacks, several strategies can be employed. One crucial step is implementing DMARC with a strong policy (p=quarantine or p=reject). This ensures that if a replayed email fails DMARC alignment checks (which it likely will if the originating IP doesn't match the SPF record, or if the From: header doesn't align with the DKIM signing domain), it will be rejected or moved to spam. Regularly monitoring your DMARC reports from Google and Yahoo is essential to identify and address any anomalies or potential replay attempts.
Another strategy involves setting an expiration date on DKIM signatures. While not universally supported by all DKIM implementations or email service providers, it's a powerful way to limit the window during which a replay attack can occur. Shortening the lifespan of a valid DKIM signature significantly reduces the risk. This best practice is often highlighted in discussions around preventing DKIM replay attacks. Additionally, organizations should promptly invalidate any compromised accounts and ensure their email security infrastructure is regularly reviewed and updated.
Example DMARC record to enable reportingDNS
v=DMARC1; p=none; rua=mailto:dmarc_reports@yourdomain.com; ruf=mailto:dmarc_forensic@yourdomain.com; fo=1;

Strengthening your email defenses

DKIM, by itself, does not fully protect against replay attacks. Its strength lies in verifying sender identity and message integrity at the point of sending. However, the absence of a built-in temporal validation or single-use mechanism means a validly signed email can be re-sent by an attacker.
This gap underscores the critical need for a holistic approach to email security. Implementing DMARC is paramount, as it leverages both SPF and DKIM to provide a policy layer that dictates how receiving mail servers should treat unauthenticated or suspicious emails. By deploying a strong DMARC policy, you gain control over how your domain's emails are handled, preventing malicious replays from reaching their targets.
For comprehensive protection and actionable insights into your email authentication, Suped offers an advanced DMARC monitoring platform. Our AI-powered recommendations help you quickly identify and fix issues, while real-time alerts ensure you're always aware of potential threats. With Suped, you get a unified platform for DMARC, SPF, and DKIM monitoring, alongside blocklist and deliverability insights, all designed to secure your email ecosystem and ensure your legitimate messages land in the inbox.

DMARC monitoring

Start monitoring your DMARC reports today

Suped DMARC platform dashboard

What you'll get with Suped

Real-time DMARC report monitoring and analysis
Automated alerts for authentication failures
Clear recommendations to improve email deliverability
Protection against phishing and domain spoofing