How to fix: MTA-STS policy max_age shorter than one week
The fetched MTA-STS policy file sets max_age below 604800 seconds, one week. RFC 8461 recommends at least that long for a policy in enforce mode.
Why it matters
max_age is how long a sending server caches the policy, and that cache is the entire protection. Once it expires the sender must fetch the policy over the network again, which is exactly the moment an attacker able to interfere with DNS or HTTPS can prevent retrieval and downgrade the connection to opportunistic TLS. A short max_age multiplies the number of those windows.
Short values are usually left over from the rollout, when a low max_age is deliberately used so a mistake can be corrected quickly. That is the right approach while testing and the wrong one afterwards. Raise it once the policy has been stable and every MX host it lists is serving a valid certificate, because a mistake will then be cached for the full duration.
How to fix it
- 1Raise max_age to at least 604800; 1209600 is common for a settled policy.
- 2Before raising it, confirm every MX host listed in the policy presents a valid certificate.
- 3Change the policy id in the _mta-sts TXT record whenever the file changes, so senders refetch rather than waiting out the cache.
Code examples
Settled policy file
version: STSv1
mode: enforce
mx: mail.example.com
max_age: 1209600Fetch the policy
curl -s https://mta-sts.example.com/.well-known/mta-sts.txtReferences
Detected automatically by VulnRadar. The check id is email-mta-sts-max-age-short, stable across every scan so you can filter or diff on it.
More email checks
- LowDMARC Forensic Report URI (ruf=) Missing
- MediumDMARC Aggregate Report URI (rua=) Missing
- MediumMTA-STS (SMTP Strict Transport Security)
- LowTLS-RPT Record Missing rua= Reporting URI
- HighSPF Exceeds 10 DNS Lookup Limit
- HighSPF Redirect Loop
- LowDMARC pct= Below 100
- MediumDMARC Policy Set to Monitor-Only (p=none)
Questions
- How severe is MTA-STS policy max_age shorter than one week?
- VulnRadar rates this low 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-mta-sts-max-age-short, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does MTA-STS policy max_age shorter than one week map to?
- It maps to CWE-16. In the OWASP Top 10 it falls under A02: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.