What Is a DKIM Replay Attack and How to Defend Against It?
Quick Answer
A DKIM replay attack occurs when attackers resend legitimate DKIM-signed emails to exploit a trusted domain. Defend against these attacks by monitoring sending activity, rotating DKIM keys, enforcing DMARC, securing private keys, and investigating suspicious email sources.
A DKIM replay attack happens when an attacker takes a real, DKIM-signed email from a trusted domain and resends it at scale, often through other infrastructure. The message can still pass message signature validation because the original message signature is intact, even though the sender did not authorize the later delivery.
Defending against DKIM replay attacks requires more than enabling DKIM. Organizations should monitor unusual message volumes, investigate suspicious sending sources, enforce appropriate DMARC policies, protect sending accounts, and maintain strong email authentication practices.
What DKIM Is and How Email Authentication Works
DomainKeys Identified Mail in plain terms
DomainKeys Identified Mail (DKIM) is an email authentication standard that allows receiving mail servers to verify whether a message was signed by the sending domain. It uses a private key to sign selected email headers and sometimes the message body, while the corresponding public key is published in DNS for verification. Proper DKIM record management, key rotation, and removal help maintain email security and prevent authentication failures.

How DKIM fits with SPF and DMARC
DKIM is only one part of email authentication. Sender Policy Framework checks whether an IP address is allowed to send for a domain. DMARC then evaluates DKIM and SPF results against domain alignment rules.
A message can pass DKIM while SPF fails. An SPF fail may happen because the message came from an unfamiliar IP address, a forwarded path, a third-party relay, or a sender missing from the sender inventory. SPF alignment helps DMARC decide whether the visible From domain matches the authenticated sending domain. Tools such as AutoSPF can help teams manage SPF records when many email service providers send on behalf of one domain.
DMARC policies can be gradually strengthened from p=none to p=quarantine and eventually p=reject. However, DMARC enforcement does not automatically block DKIM replay attacks when a replayed message still passes aligned DKIM authentication. Reviewing aggregate (RUA) reports helps administrators identify unexpected sending sources, authentication patterns, and potential email abuse.
Defining DKIM Replay Attacks: How They Happen
The attack pattern
In a DKIM replay attack, the attacker first obtains a legitimate signed email. It might come from a newsletter, receipt, passwordless login message, shared inbox, compromised mailbox, or mailing list archive. The attacker does not need the private key. They only need a signed message whose message signature still verifies against the domain’s public key.
Then comes the malicious replay. The attacker resends that same message, sometimes many times, to new targets. If the signed headers and body remain within the DKIM signature scope, the recipient domain may accept the mail as authenticated. That is the core weakness: DKIM proves the message was signed once, not that every later delivery was authorized.

Relay vs replay
A legitimate relay forwards mail as part of normal delivery. A school, employer, security gateway, or mailing list may act as a relay. The difference in relay vs replay is intent and control. A normal relay handles in-flight email along an expected path. A replay sends a previously signed message into new paths, often from infrastructure the brand never approved.
Security gateways and CASB products may see the same signed message arrive from strange sources. That can be an early clue, especially when the DKIM message signature passes but SPF, PTR, or reputation checks look wrong. A missing or suspicious PTR record does not prove a DKIM replay attack, but it can add useful message-level evidence.
Why content may still look “valid”
Many attacks avoid content forgery because changing signed content can break DKIM. Instead, attackers choose messages that already contain links, brand language, invoices, tracking URLs, or calls to action. DKIM verifies the message body and selected headers covered by its signature. If important user-visible headers are left unsigned, attackers may have opportunities to manipulate certain message fields without invalidating the signature. Signing all relevant user-visible headers helps reduce this risk.
Why DKIM Replay Is Dangerous for Brands, Senders, and Recipients

Brand and reputation damage
A DKIM replay attack can harm a brand’s email reputation by creating large volumes of DKIM-passing messages that appear to come from its domain, even when its systems did not send them. This can affect email deliverability and cause legitimate transactional messages to land in spam. Trusted organizations, including government agencies, educational institutions, banks, healthcare providers, and major consumer brands, are especially attractive targets because attackers can exploit their established credibility.
Operational risk for senders
DKIM replay attacks can create operational challenges for email administrators, who may first detect the issue through customer complaints, unusual bounce rates, or abuse reports. Without reliable DMARC aggregate reports, provider logs, and an updated inventory of authorized senders, identifying the source and responding effectively becomes difficult. Incorrectly rotating DKIM selectors or removing active public keys can also disrupt legitimate email delivery from authorized service providers.
Recipient risk
For recipients, DKIM replay attacks make fraudulent emails harder to recognize because messages may display a familiar brand name and pass technical email authentication checks. Replayed messages can expose users to outdated promotions, reused links, credential theft attempts, and social engineering. Although DMARC provides an important layer of protection, it cannot automatically block replayed messages that retain valid, aligned DKIM signatures. Organizations should combine DMARC enforcement with sending-pattern analysis, abuse monitoring, and additional email security controls to identify suspicious activity.
Best Practices to Defend Against DKIM Replay Attacks

Rotate DKIM Keys on a Schedule
Rotate DKIM keys periodically as part of routine security maintenance. Create new selectors, publish their corresponding public keys in DNS, and transition authorized sending systems to the new private keys. Retire old selectors only after confirming that legitimate email systems no longer depend on them. Remember that key rotation alone does not prevent DKIM replay attacks.
Clean Up Old DNS Records
Regularly review DKIM DNS records and remove obsolete selectors after confirming they are no longer used by authorized sending services. Maintain an updated inventory of active email providers and their authentication records to reduce configuration risks and prevent accidental disruption to legitimate email delivery.
Strengthen DMARC Enforcement
Implement DMARC enforcement gradually, starting with monitoring, movindg to quarantine, and eventually using reject. Regularly check SPF, DKIM, alignment, and aggregate reports to protect email domains.
Limit Who Can Send and Sign
Restrict email-sending and DKIM-signing permissions to trusted services and authorized users. Protect private keys and review access controls to prevent unauthorized email activity.
Build an Incident Playbook
Create an incident response plan for suspected DKIM replay attacks. Preserve evidence, review reports, investigate affected selectors, contact providers, and rotate compromised keys when necessary.
General Manager
General Manager of DuoCircle. Product strategy and commercial lead for AutoSPF's 2,000+ customer base.
LinkedIn Profile →