Skip to main content
MediumEmailOWASP A05:2021CWE-16

How to fix: Multiple SPF records published

The domain publishes more than one TXT record beginning with v=spf1, which RFC 7208 forbids. Exactly one is allowed, and a domain with two or more is a permanent error.

Why it matters

A receiver that finds two SPF records does not merge them or pick one: it returns permerror and abandons SPF evaluation entirely. The domain is left with no working sender policy, so mail from any source clears the SPF stage, and DMARC alignment has only DKIM left to fall back on. A second SPF record is worse than having none, because it looks configured.

This almost always happens when a second service is onboarded and its setup guide says to add a TXT record: the record is added alongside the existing one rather than merged into it. The fix is a single record containing every include, which is also the point at which the ten-lookup limit starts to matter, so merging is a good moment to count the DNS-querying mechanisms.

How to fix it

  1. 1Merge every mechanism into one v=spf1 TXT record at the apex and delete the others.
  2. 2Count DNS-querying mechanisms while merging: include, a, mx, ptr, exists and redirect each cost one against a limit of ten.
  3. 3Re-check with a validator after merging, since exceeding the lookup limit produces the same permerror you were fixing.

Code examples

One merged record

DNS
example.com. IN TXT "v=spf1 include:_spf.google.com include:sendgrid.net ~all"

Find the duplicates

bash
dig +short TXT example.com | grep -c 'v=spf1'

References

Detected automatically by VulnRadar. The check id is email-spf-multiple-records, stable across every scan so you can filter or diff on it.

See every email check

Questions

How severe is Multiple SPF records published?
VulnRadar rates this medium severity in the email category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id email-spf-multiple-records, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Multiple SPF records published map to?
It maps to CWE-16. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for multiple spf records published

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: Multiple SPF records published | VulnRadar