Skip to main content
LowTLSOWASP A02:2021CWE-324

How to fix: Certificate validity period exceeds 398 days

The leaf certificate's notBefore to notAfter window is longer than 398 days. That is the maximum the CA/Browser Forum Baseline Requirements have imposed on publicly trusted certificates since September 2020.

Why it matters

The validity window is the exposure window. If the private key is compromised, the certificate keeps working until it expires unless revocation actually reaches clients, and browsers soft-fail revocation checks, so in practice it does not. A long-lived certificate also outlives the key-size, algorithm and CA-policy changes that renewal would otherwise pick up.

Public CAs cannot issue beyond 398 days, so a longer certificate is normally a private CA, an appliance that installed its own, or one issued before the limit took effect. Short lifetimes are valuable mainly because they force renewal to be automated, and automated renewal is what makes an emergency rotation a routine operation rather than an outage.

How to fix it

  1. 1Reissue with a validity period of 398 days or less; 90 days is now the common default.
  2. 2Automate renewal with ACME or the hosting platform's managed certificates so short lifetimes cost nothing operationally.
  3. 3Alert on approaching expiry rather than relying on a calendar reminder.

Code examples

Check the window

bash
openssl s_client -connect example.com:443 </dev/null 2>/dev/null \
  | openssl x509 -noout -dates

Automated renewal with certbot

bash
certbot certonly --nginx -d example.com -d www.example.com
systemctl enable --now certbot.timer

References

Detected automatically by VulnRadar. The check id is tls-cert-validity-period-excessive, stable across every scan so you can filter or diff on it.

See every tls check

Questions

How severe is Certificate validity period exceeds 398 days?
VulnRadar rates this low severity in the tls 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 tls-cert-validity-period-excessive, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Certificate validity period exceeds 398 days map to?
It maps to CWE-324. 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 certificate validity period exceeds 398 days

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

Certificate validity period exceeds 398 days fix | VulnRadar