skip to content

A legitimately DKIM-signed message is resent intact to thousands of new recipients and still passes; why does it verify, and what limits DKIM replay?

level: seniorimportance: nice to knowfreq 14%

answer

  1. what the envelope is
  2. signature travels with content
  3. x= is not anti-replay
  4. same signature, unusual volume

basics

~20 s

DKIM signs the h= header fields and the body, not the SMTP envelope, so a signed message re-sent to new recipients still verifies. RFC 6376 offers only partial limits, reputation and spotting one signature on unusual volume, and x= is not one.

solid answer

~50 s

A DKIM signature binds a domain to a set of header fields and a body. The envelope, `MAIL FROM` and `RCPT TO`, is outside it, so a message re-sent intact to recipients the author never chose keeps a valid signature; RFC 5585 lists this as something DKIM does not protect against. RFC 6376 section 8.6 offers only partial solutions: reputation services learning that a signer is being used for spam, and large verifiers noticing an unusually large volume of mail with the same signature in a short time, which smaller ones can approximate through collaborative systems. `x=` does not help: RFC 6376's own note says it 'is not intended as an anti-replay defense'. For the alert, read the pass as 'example.com signed these bytes once', not 'example.com sent this to you', and act on volume and the envelope.

go deeper

for a junior

Recall what a DKIM signature covers, chosen header fields and the body, and that the SMTP envelope is outside it.

for a middle

Explain why that makes replay possible and why x= is not an anti-replay defence, citing RFC 6376's own informative note.

for a senior

Show how you would work the alert: group deliveries by signature, compare envelope recipients with the signed To and Cc, and act on volume rather than on the DKIM result.

for a principal

Discuss the tradeoff behind replay: a signature that survives forwarding is necessarily reusable, so the defence belongs in reputation and volume analysis shared across receivers.

## What the signature covers A DKIM verifier checks two things: a hash of the message **body** (`bh=`) and a signature (`b=`) over the **header fields listed in `h=`** plus the `DKIM-Signature` field itself. Nothing else goes into the input. | Part of the message | Covered by the signature? | |---|---| | Body (up to `l=` octets, if that tag is set) | yes | | Header fields named in `h=`, such as `From`, `Subject`, `To` | yes | | Header fields not in `h=`, and trace fields added later | no | | SMTP envelope: `MAIL FROM`, `RCPT TO` | no | | The connecting server's IP address | no | That design is what lets DKIM survive forwarding: the signature travels with the content and does not care which server delivers it, or to whom. The same property means a message once signed can be delivered again, intact, to new envelope recipients, and **still verify**. RFC 5585 states it plainly: DKIM does not protect against re-sending a message that already has a verified signature. RFC 6376 section 5.4.1 says the same from the signer's side: with the core header fields signed, 'the core of the message is valid, even if sent on to new recipients'. ## Replay, at concept level RFC 6376 section 8.6 and RFC 4686 section 4.1 describe the risk. A genuinely signed message from a well-reputed domain is re-sent, unchanged, to a large number of recipients its author never chose. Those receivers see a valid signature from a trusted domain and may trust the message more. RFC 4686 separates the case where a message was produced in order to be signed from the case where an existing signed message is re-sent; to a verifier the two look the same. It also notes that mailing lists which do not modify messages perform a benign form of the same thing, and the network cannot tell the two apart except by intent. The damage runs two ways: recipients get unwanted mail carrying a trusted name, and the signing domain's reputation suffers for mail it never addressed to them. ## Why x= is not the answer The `x=` tag sets an expiry time after which verifiers MAY consider a signature invalid. RFC 6376 adds an informative note that `x=` 'is not intended as an anti-replay defense', and the mechanics explain why: - honouring `x=` is optional for verifiers; - a replay can follow within minutes of signing, inside any expiry a signer could set without breaking legitimately delayed mail; - the expiry says nothing about recipients, which is exactly what a replay changes. ## What limits it RFC 6376 calls the available measures **partial solutions**: 1. **Reputation.** Services that track signers can learn that mail under one signing identity is being used for spam and lower its standing. RFC 6376 warns this can be abused too: re-sending a victim's legitimate mail can make the victim look like a spammer. 2. **Volume detection.** Large verifiers 'might be able to detect unusually large volumes of mails with the same signature in a short time period'; smaller verifiers can get similar information through collaborative systems. 3. **Revocation.** The signing domain can revoke the key, but RFC 6376 section 8.7 notes this is limited when one key signs mail for many users, and RFC 4686 notes that a replay can move faster than detection and revocation. 4. **Signer accountability.** RFC 4686 points out that domains which sign only for accountable account holders make signed messages harder to obtain; that is a signer's choice, covered with DKIM signing. ## Working the alert The alert says one legitimately signed message reached thousands of your users. Read it as a receiving operator: - **Group by signature.** The same `d=`, selector and identical `b=` value across many deliveries means these are copies of one signed message. That is normal for one message with many envelope recipients from its own sender, and suspicious when the copies arrive from unrelated sources long after the `t=` signing time. - **Compare envelope and header.** Envelope recipients that appear nowhere in the signed `To` or `Cc` fields suggest the author did not address the message to them. - **Weigh the pass correctly.** The pass proves the signing domain signed these bytes once. It does not prove the domain sent them to you, or wanted them sent. - **Act on volume and content**, not on the DKIM result: rate-limit or quarantine the stream by its signature, and tell the signing domain so it can review the account that produced the message. The point for an interview: DKIM authenticates **content and a signing domain**, not a delivery. Replay is the price of a signature that survives forwarding, and the defences live in reputation and volume analysis, not in the signature itself.

  • Would a very short x= expiry stop DKIM replay?
    No. RFC 6376 notes `x=` is not intended as an anti-replay defense. Verifiers only MAY honour it, a replay can follow within minutes of signing, and an expiry short enough to matter would also invalidate legitimate mail delayed in queues. It limits how long a signature is meant to be checked, not who receives the message.
  • Why doesn't a DKIM signature simply cover RCPT TO to prevent replay?
    The envelope changes legitimately in transit: forwarders and lists deliver the same message to new recipients, and one message to many recipients is split across destination servers. Binding the signature to the envelope would break the forwarding DKIM is meant to tolerate. RFC 5585 accepts replay as a limit of the design.
  • Does revoking the signing key help once DKIM replay is detected?
    Partly. An empty `p=` makes copies verified after the change fail, but RFC 6376 section 8.7 notes the collateral cost when one key signs mail for many users, and RFC 4686 notes that replay can outrun detection. Revocation is the signing domain's lever, not the receiver's.

  • A re-sent DKIM-signed message fails because its envelope recipients changed.
  • The x= expiry tag is DKIM's defence against replay.
  • A DKIM pass proves the signing domain sent the message to you.
  • Verifiers reject a DKIM signature they have already seen once.
  • Revoking the key stops a replay instantly with no side effects.