security-txt.eu

AdviceAs of 9 min read

security.txt expired: what the Expires date means and how to stay on top of it

Every security.txt carries an expiry date. Once it has passed, the file counts as stale and checking services report an error, even though nothing about your contacts has changed. This page explains why the field exists, which format is valid, how far ahead you may set it and how to stop it from quietly running out again.

Why security.txt has an expiry date

A security.txt tells outsiders where to report a vulnerability in your systems or products. If the address is no longer right, because the mailbox was deleted, the team changed or the reporting page disappeared in a relaunch, the report goes nowhere or to the wrong people. RFC 9116 takes this risk seriously: section 5.3 states that having no security.txt at all may be preferable to having one with stale information.

That is why Expires is, next to Contact, the only mandatory field. It must appear exactly once (RFC 9116 section 2.5.5) and names the point in time after which the data is considered stale and should not be used. The date is not a formality but a promise: until that day, you vouch for the contacts being correct.

How often this goes wrong is shown by an analysis of the top one million domains by uriports, published on 24 January 2025: 45 percent of the files found had no Expires field at all, in 13 percent it had already passed, and in 20 percent it was set too far into the future.

What happens once it has expired

On the day after the expiry date, nothing changes on your server. The file is still at /.well-known/security.txt and is still served. What changes is how everyone who reads it treats it:

  • Reporters should stop using the data. That is what RFC 9116 says. Those who follow it look for another route, write to a generic address or give up.
  • Checking services and scanners flag the file. Our checker reports an expired file as an error, as do other tools. The finding then turns up in security ratings, penetration test reports or supplier questionnaires, and someone has to explain it.
  • The file looks abandoned. To an outsider, an expired date is the clearest sign that nobody looks after the reporting channels. For a manufacturer that wants to show it is ready to receive vulnerability reports, that is the wrong message.

An expired date does not technically invalidate the contacts. Mail to your address is still delivered. But you lose the reports from careful researchers, and those tend to be the valuable ones.

The correct format

RFC 9116 takes the date-time format from RFC 3339, section 5.6. A valid value always consists of a date, the separator T, a time including seconds and a time zone designator. Fractions of a second are allowed. The simplest and least error-prone choice is UTC with Z:

Expires: 2027-09-30T22:00:00.000Z

Equivalent, but with an offset from UTC, would be 2027-10-01T00:00:00+02:00. Both describe the same instant: midnight Central European Summer Time on 1 October 2027.

The German technical guideline BSI TR-03183-3 is stricter than the RFC: the separator T and the zone designator Z must be upper case, and no other separators may be used (4.2.9 a). RFC 3339, on the other hand, explicitly allows lower case t and z, and the example in RFC 9116 itself ends in a lower case z. Writing them in upper case keeps you safe under both standards.

ValueRFC 9116BSI TR-03183-3Why
2027-09-30T22:00:00.000Zvalidvaliddate, T, time, Z: this is what it should look like
2027-10-01T00:00:00+02:00validvalidan offset from UTC instead of Z is allowed
2027-09-30t22:00:00zvaliderrorlower case t and z, not allowed under TR 4.2.9 a
2027-10-01errorerrortime and time zone missing
2027-10-01T00:00:00errorerrortime zone missing, the instant is ambiguous
2027-10-01 00:00:00Zerrorerrorspace instead of T, the grammar requires T
10/01/2027errorerrorlocal date format, not RFC 3339
2027-02-30T00:00:00Zerrorerrorthere is no 30 February
two Expires lineserrorerrorthe field may appear only once
date more than a year aheadwarningwarningRFC recommends less than a year, TR at most one year

Two details that are easy to miss: field names are case insensitive, so expires: is recognised. And the date only counts outside comments. A line such as # Expires: 2030-01-01T00:00:00Z is a comment, not an expiry date; without the real line, the mandatory field is missing.

How far into the future?

RFC 9116 recommends a value less than a year into the future (section 2.5.5). The TR puts it as a "should": at most one year (4.2.9 b). A date five years ahead is therefore not a format error, but checking services flag it because it defeats the purpose of the field. If you see the message "expires too far in the future", that is what it means.

The better question is how short to make it. The shorter the interval, the more often you have to renew, but also the more often someone checks whether the data is still correct. Three approaches work well in practice:

ApproachExpiresSuits
Yearlyjust under a year ahead, around 360 dayscompany websites without their own products, working to RFC 9116
With the quarterly reviewreset to about a year ahead at every reviewmanufacturers following the TR, who have to review quarterly anyway
Short and automateda few months, reset and signed by a scriptlarge estates with many domains and established automation

Independently of the expiry date, the TR requires the information to be reviewed and corrected at least every quarter (4.2.9 c). That makes the second approach almost automatic: if you check every three months anyway, reset the date at the same time. It then never falls below nine months ahead, and expiry practically cannot happen.

Also avoid dates when nobody is around. 31 December, a bridge day or the middle of the summer holidays are poor choices, because that is exactly when the reminder reaches no one.

Renewing in four steps

Overwriting the date is not enough if the file is signed. Recommended by RFC 9116 and mandatory under the TR, the signature makes sure any change is noticed. A new date without a new signature breaks the signature. This is how to proceed:

  1. Review the content, not just the date. Does every address in Contact still exist, and does someone read it? Do the links to the policy, keys and reporting page still work? Is Canonical still right after a website move? Send a test message to every address.
  2. Set a new date. At most one year ahead, with upper case T and Z. The generator suggests a suitable value: one year minus one day.
  3. Sign again. Remove the old signature and sign the file again with your signing key. The commands and the typical error messages are under Signing and verifying the signature. Check beforehand that the key itself is valid for long enough (see the next section).
  4. Upload and check. Upload the file unchanged, in binary mode, so that no program rewrites the character set or line endings. Then run the checker: it shows the new date, the days remaining and whether the signature matches.

A cache in front of the website, such as a CDN, may keep serving the old file for a while. If the checker still shows the old date, purge the cache for /.well-known/security.txt.

File expiry and key expiry are two different dates

A signed security.txt involves at least two expiry dates that have nothing to do with each other: the Expires of the file and the validity of the OpenPGP keys used to sign it and offered for encryption in the Encryption field. The TR allows keys a maximum of five years (4.2.10 e); two years is common.

Expires of the fileExpiry of the key
Where is it?a line in security.txtinside the key, shown with gpg --list-keys
How long?at most one yearusually two years, at most five under the TR
Effect of expirythe file counts as stalesignatures or encryption with that key are flagged
Renewingnew date, sign again, uploadextend validity, export and upload the .asc again, fingerprint stays the same

The most common mistake: the file is renewed on time and signed with a key that expires two weeks later. So check the keys every time you renew. If one expires before the new Expires date, extend it first. Our checker warns as soon as a key referenced by the file expires in less than 60 days and treats an expired key as an error under the TR. How to extend keys and what to do if one is lost is covered under When a key expires.

Who takes care of it

An expiry date almost never runs out because someone did it wrong, but because nobody was responsible. The file was created once, the person left the company, and the next time anyone notices is when a scanner does. Three things prevent that:

  • A named role instead of a person. The team that runs the security mailbox is responsible: the PSIRT at a manufacturer, otherwise IT management. Write the responsibility into internal documentation, not just into someone's head.
  • A deadline with lead time. A calendar entry for a shared mailbox or a group, 30 days before expiry, linking to this page. Better still, a recurring ticket in the system your team already uses: a ticket stays open until someone closes it, a calendar entry simply disappears.
  • A record. If you follow the TR, you have to review quarterly. Note the date, the person and the result of each review. That also helps when a customer or auditor asks how your reporting channels are maintained.

Let a script keep watch

If you already run scripts or a pipeline for your website, you can monitor the remaining validity automatically. This small script reads the expiry date from the published file and exits with an error if fewer than 45 days are left. It works with GNU date on Linux, for example as a daily cron job or as a step in a CI pipeline:

#!/bin/sh
# Warns when security.txt expires in fewer than 45 days
url="https://www.example.com/.well-known/security.txt"
exp=$(curl -fsS "$url" | sed -n 's/^[Ee][Xx][Pp][Ii][Rr][Ee][Ss]: *//p' | tr -d '\r')
days=$(( ( $(date -d "$exp" +%s) - $(date +%s) ) / 86400 ))
echo "$url expires in $days days ($exp)"
[ "$days" -ge 45 ] || exit 1

The script only checks the date. It does not see whether the signature matches, whether the links work or whether a key is about to expire. If the file is missing or the date is broken, it stops with an error, which is the behaviour you want from a monitor.

If you generate the file in a pipeline, you can go one step further: the date is reset on every build and the file signed automatically. That requires the signing key to live on the build system. Whether you want that is a trade-off: whoever controls the build can then also publish a validly signed file with the wrong contacts. An alternative is to check the date automatically and keep the signing step manual.

Many domains and subdomains

A security.txt only applies to the domain it is retrieved from, not to its subdomains or parent domain (RFC 9116 section 3.1). If you are reachable at company.com, www.company.com, shop.company.com and three country domains, you quickly end up with a dozen files and a dozen expiry dates.

It gets simpler with a single file for all of them: RFC 9116 allows the Canonical field to appear more than once (section 2.5.2). List every address the file is served from, sign once and deploy the same file to every domain. You are left with one Expires date and one renewal:

Contact: mailto:security@company.com
Expires: 2027-09-30T22:00:00.000Z
Canonical: https://company.com/.well-known/security.txt
Canonical: https://www.company.com/.well-known/security.txt
Canonical: https://shop.company.com/.well-known/security.txt

What matters is that each domain serves the file itself. The TR requires the canonical URI to be reachable without redirects (4.2.2 c), so a redirect from shop.company.com to the main domain does not replace a file of its own. And after every renewal, check all domains, not just the first: rarely maintained subdomains are exactly where the old version tends to linger.

Stop having to remember the date. Monitoring checks your security.txt every day with the same rules as the checker and reminds you 30, 14, 7 and 1 day before the expiry date, and before a key from the file expires. If the file disappears or the signature no longer matches, you hear about it straight away. Up to 10 domains per subscription, EUR 60 per year per domain, excl. VAT. See monitoring

Frequently asked questions

My security.txt has expired. What do I need to do?

First check that all contacts are still correct. Then set a new Expires at most one year ahead, sign the file again if it is signed, upload it and verify the result with the checker. It usually takes less than half an hour.

What date format does Expires need?

The date-time format from RFC 3339: date, upper case T, time with seconds and time zone, for example 2027-09-30T22:00:00.000Z. A date without a time or without a time zone is invalid. Under BSI TR-03183-3, T and Z must be upper case.

How far in the future can Expires be?

RFC 9116 recommends less than a year, BSI TR-03183-3 at most one year. A later date is not a format error, but checking services report it as a warning.

What does "expires too far in the future" mean?

The expiry date is more than a year ahead. Checking services point this out because a date many years ahead defeats the purpose of the field. Set it to one year at most and sign again.

Does my contact address still work after expiry?

Technically yes, mail is still delivered. But under RFC 9116, reporters should no longer use the data in an expired file. Careful researchers will then look for another route or not report at all.

Do I have to sign again after changing Expires?

Yes, if the file is signed. The signature covers the whole content; a single changed character breaks it. Sign the file again after every change.

Is the file's expiry date the same as the key's?

No. Expires applies to the file and is at most one year. The OpenPGP key has its own validity, usually two years, at most five under the TR. Each needs its own reminder.

Do I need a separate expiry date for every subdomain?

Every domain needs its own file, but not necessarily its own version. With several Canonical lines, the same signed file can be served on every domain, leaving a single Expires date to maintain.

Sources