Skip to main content
LowEmailOWASP A02:2021CWE-16

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

  1. 1Raise max_age to at least 604800; 1209600 is common for a settled policy.
  2. 2Before raising it, confirm every MX host listed in the policy presents a valid certificate.
  3. 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

text
version: STSv1
mode: enforce
mx: mail.example.com
max_age: 1209600

Fetch the policy

bash
curl -s https://mta-sts.example.com/.well-known/mta-sts.txt

References

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.

See every email check

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.

Propose a checkHow a check is built

Scan your own site for mta-sts policy max_age shorter than one week

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

MTA-STS policy max_age shorter than one week fix | VulnRadar