Can a Delegated DKIM CNAME Become a Security Liability After Offboarding?

dkimfaq

Delegating a DKIM selector to an email service provider is usually a sensible operational choice. You publish a short CNAME, the provider hosts the public key, and the provider can rotate its signing keys without asking you to edit a long TXT record every few months.

The risk appears when the contract ends and everyone assumes that deleting an account, or simply stopping a campaign, has removed the signing relationship.

It may not have.

An old selector CNAME does not automatically let anyone send mail. But it can preserve a live trust path to your domain, leave a provider-controlled dependency in production DNS, or create confusion about which organization is still allowed to sign. Offboarding must close the entire path, not just the commercial relationship.

What a delegated DKIM CNAME actually delegates

Suppose a provider asks for this record:

news._domainkey.example.com. IN CNAME news-example-com._domainkey.sender.example.net.

The provider then signs a message with something like:

DKIM-Signature: v=1; d=example.com; s=news; ...

A receiver looks up news._domainkey.example.com, follows the CNAME, and retrieves the DKIM public key from the provider's target. The corresponding private key stays in the provider's signing system.

This is selector-level indirection. It is not the same as delegating your whole DNS zone or handing over your domain registration. RFC 6376 explicitly describes selectors as a way to support multiple keys and to delegate signing capability for a particular use or partner.

That narrow scope is important. The provider is not automatically authorized to sign every selector under the domain. It is authorized wherever the domain owner has published the relevant DNS records and enabled the corresponding sending configuration.

Why the old CNAME can matter after offboarding

There are two different questions:

  1. Does the old CNAME still exist in your DNS?
  2. Can the former provider still create a valid, aligned signature for your domain?

The first is a hygiene and dependency question. The second is a security and governance question.

If the provider still has an active tenant, API credential, sending permission, and private key, it may be able to send mail that verifies as d=example.com while the old CNAME remains in place. That mail could pass DKIM and potentially contribute to DMARC alignment. The fact that the marketing team no longer uses the service does not prove that the signing path is disabled.

The reverse is also possible. Removing the CNAME can make new messages fail DKIM, but it does not necessarily disable a provider account, revoke its private key, or stop other authentication paths. DNS cleanup is necessary, not always sufficient.

A delegated selector is part of the domain's signing inventory. Treat it like an access grant with a DNS representation, not like an ordinary campaign setting.

Three offboarding risks to separate

1. The former provider can still sign

This is the most direct risk. The provider may retain:

  • an active workspace or sending account
  • an authenticated API integration
  • a custom-domain signing configuration
  • a private key associated with the selector
  • permission to send from the domain or a sending subdomain

An attacker who compromises that provider account may inherit the same ability. The resulting messages are not ordinary spoofing attempts. They use a legitimate signing path that the domain owner previously created.

Do not infer capability from recent traffic alone. A selector that has not appeared in a report for thirty days may still be configured and usable.

2. The CNAME target becomes a dangling dependency

A CNAME points somewhere outside your zone. If the provider retires, renames, or restructures the target, the record can become broken. If the target is later reassigned inside the provider's platform, ownership and tenant-isolation controls become relevant.

This is not a universal "dangling CNAME takeover" vulnerability. A target under a well-managed provider's authoritative domain is not automatically claimable by an unrelated party. The practical concern is that your organization may no longer know who controls the target, whether it is still reserved, or whether an old customer identifier can be attached to a new tenant.

The risk is highest when a target uses a provider-specific customer identifier, a retired product hostname, or a shared namespace with unclear reclamation rules. Ask the provider whether the target remains reserved, whether it can be reused, and how the old key is retired.

3. Stale DNS creates false confidence

An old CNAME can remain visible in DNS after a provider is gone. That can cause several operational problems:

  • responders may assume the provider is still approved
  • a new provider may be configured around a selector it does not control
  • an old key may be mistaken for the current production key
  • an audit may miss a second provider because the selector name looks familiar
  • future DNS changes may accidentally restore an abandoned signing path

Stale records are not proof of active compromise. They are evidence that ownership and lifecycle control are incomplete.

A CNAME is not a revocation mechanism

DNS tells verifiers where to find the public key. It does not provide a universal command to erase a private key from a provider's systems.

RFC 6376 Section 3.1 explains that a key can be removed or revoked by changing the public-key record. That affects verification, but it is not the same as proving that every copy of the private key has been destroyed or that an account can no longer sign.

The cleanest offboarding sequence therefore has two sides:

  • disable the provider-side signing and sending capability
  • remove or replace the domain-side DNS delegation

If the provider supports explicit key revocation, use it. If it supports deleting the custom-domain signing configuration, record that action and its timestamp. Keep the evidence with the offboarding ticket.

What happens if the CNAME is simply deleted?

Deleting the CNAME means a receiver will usually be unable to retrieve the expected public key for messages signed with that selector. New messages using it should fail DKIM verification after caches expire.

That is useful, but there are caveats:

  • DNS resolvers can retain the old answer until its TTL expires
  • messages already in transit may be verified against cached data
  • the provider may have another selector or another aligned signing domain
  • SPF could still align for the provider's envelope domain
  • a second DKIM signature may continue to produce a DMARC pass
  • a different sending subdomain may have its own delegated selectors

DMARC needs at least one aligned authentication result to pass. Removing one DKIM selector does not prove that all paths for the visible From domain are gone. Review the complete sender inventory and test actual messages after the change.

The provider target deserves an ownership review

For every CNAME, record both ends of the relationship:

Customer-owned selector: news._domainkey.example.com
Provider target:         news-example-com._domainkey.sender.example.net
Signing domain observed: example.com
Provider account:        customer-12345
Business owner:          Marketing Operations
Status:                  Retired

The target is not just a technical detail. It tells you where the public key is hosted and which provider-side object must be retired.

Ask these questions before closing the offboarding task:

  • Is the target still served by the provider's authoritative DNS?
  • Is it still associated with the old tenant, or can it be reassigned?
  • Does the provider retain the old private key?
  • Can the old tenant still send with the custom signing domain?
  • Are selectors globally unique within the provider's platform?
  • What evidence shows that the signing configuration was disabled?

If the provider cannot answer the ownership questions, remove the CNAME and rotate any overlapping selectors or keys. Do not leave a third-party dependency in production DNS merely because it resolves today.

An offboarding runbook that closes the path

Use a sequence that preserves evidence before changing DNS.

1. Capture the live configuration

Export the provider's domain, selector, target, account, sending subdomains, and key status. Save a current DNS response and at least one representative message header if the sender is still active.

The header should give you the values that matter:

DKIM-Signature: d=example.com; s=news; ...
Authentication-Results: ... dkim=pass header.d=example.com header.s=news

The actual d= and s= values are more reliable than a setup screen or an old implementation document.

2. Disable provider-side sending

Remove API keys, SMTP credentials, webhooks, custom-domain permissions, and sending identities associated with the old account. Ask the provider to disable the domain and destroy or revoke the associated private key where its product supports that operation.

If a provider cannot disable signing independently of the account, disable or close the account before removing DNS, while preserving the provider's confirmation.

3. Remove the selector CNAMEs

Delete only the records belonging to the retired provider. Do not remove a selector that is still used by another approved stream without checking the live headers first.

Remember that a CNAME owner cannot also contain an unrelated TXT record. RFC 1034 Section 3.6.2 defines the CNAME owner as an alias and says that no other data should be present at that node. If a replacement provider needs the same selector, use a controlled cutover rather than publishing both record types.

4. Rotate when names or keys overlap

If the retired provider knew a private key that was also used elsewhere, replace it with a new selector and key pair. Prefer a new selector instead of recycling the old name. Reusing a selector makes it difficult to distinguish messages signed with the previous key from messages signed with the replacement key, as RFC 6376 notes.

5. Verify after TTL expiry

Query the authoritative nameservers and multiple public resolvers. Then send a controlled message through every remaining legitimate path and inspect its headers.

Useful checks include:

dig CNAME news._domainkey.example.com +short
dig TXT news._domainkey.example.com +short
dig TXT news-example-com._domainkey.sender.example.net +short

The expected result for a retired selector is no longer a usable provider-hosted key. A cached answer may persist temporarily, so compare the observed result with the record TTL and the time of change.

6. Watch reports and delivery evidence

Review DMARC aggregate reports, bounce events, provider activity logs, and security alerts for the old d= and s= values. Reports are useful for finding continued use, but they are not a complete per-message log. Pair them with provider logs and captured headers.

What not to do

Several shortcuts create more uncertainty than protection:

  • Do not assume an unused selector is harmless without checking provider-side access.
  • Do not delete every _domainkey record when retiring one sender.
  • Do not reuse the old selector immediately for a new provider.
  • Do not treat a resolving CNAME as proof that the provider still owns the intended tenant.
  • Do not rely on DMARC aggregate reports alone to prove that sending has stopped.
  • Do not leave the former provider's API credentials active because the CNAME was removed.

The goal is not to make every delegated DKIM record permanent or to ban CNAME-based key hosting. The goal is to make each delegation time-bound, attributable, and removable.

A safer operating model for delegated selectors

Delegated DKIM works well when the organization treats it as a controlled external access path:

  • use a dedicated sending subdomain for higher-risk or high-volume providers
  • give each provider distinct selectors rather than sharing names
  • keep a DNS-to-provider inventory with a business owner and expiration date
  • require provider-side disablement as part of offboarding
  • monitor actual d= and s= values in delivered mail
  • review stale selectors at least as often as vendor access
  • rotate keys and selectors when ownership is uncertain

The DKIM delegation audit checklist covers the ongoing configuration review. Offboarding adds one crucial question to that checklist: can the retired provider still produce an aligned DKIM pass for this domain?

The key takeaway

A delegated DKIM CNAME does not become dangerous merely because it points to another domain. It becomes a liability when the organization forgets that the CNAME represents an active trust relationship with a provider-controlled key service.

Close both halves of that relationship. Disable the provider-side signer, remove the DNS delegation, rotate overlapping keys, and verify the result in real headers after DNS caches have expired. A clean offboarding record should make it clear not only that the vendor is gone, but also that it can no longer sign as the domain.

Previous Post