sec-ref.tools

security.txt validator and generator

A security.txt file tells anyone who finds a vulnerability in your site how to report it. RFC 9116 defines the format, and two of its fields are mandatory: at least one Contact, and exactly one Expires. Paste a file to check it rule by rule, or fill in the form to generate one. Checking happens in your browser; nothing is fetched or sent.

Check a file

Generate a file


    

Where the file goes

Serve it at https://your-domain/.well-known/security.txt, over HTTPS, as text/plain in UTF-8. That location is required. For older tools you may also serve the file at the site root (/security.txt), or redirect the root to it, but a root copy on its own does not meet the standard, and where both exist the one under /.well-known/ wins. A file applies only to the domain in the address used to fetch it: example.com's file says nothing about www.example.com or shop.example.com. RFC 9116 allows the request to be redirected, so each host can redirect its /.well-known/security.txt to one shared file, which readers are asked to inspect before trusting; a Canonical field listing each address, ideally in a signed file, tells them the redirect is intended.

The fields

FieldRequired?What it holds
ContactYes, one or moreHow to report: a mailto:, tel: or https:// URI. A bare email address is not valid; it needs the mailto: prefix. List them in order of preference.
ExpiresYes, exactly onceWhen the file goes stale, as a full date and time with a time zone, such as 2027-06-30T23:59:00Z. A date on its own is not valid. Less than a year ahead is recommended.
EncryptionNoA link to the key researchers should encrypt with. Never the key itself.
PolicyNoA link to your vulnerability disclosure policy.
AcknowledgmentsNoA link to a page thanking researchers.
CanonicalNoThe URLs where this file is meant to be found. Recommended when the file is signed.
Preferred-LanguagesNo, at most onceComma-separated language tags, such as en, fr.
HiringNoA link to security job openings.

Any web link in these fields must start with https://. Field names are not case-sensitive, a single space follows each colon, and lines starting with # are comments. Fields this checker does not know about are reported for information only: the RFC tells researchers to ignore fields they do not support, and the IANA registry adds new ones (such as CSAF).

Why Expires is the field that fails

Most of RFC 9116 is set once and left alone. Expires is the exception: it is mandatory, it must be in the future for the file to be usable, and the RFC recommends keeping it under a year ahead. A file written by hand with a one-year expiry goes stale a year later unless someone remembers it. The fix is the same as for certificates: generate the file as part of a regular deployment, with the expiry set a few months ahead each time, and check it from monitoring. This site's own files are rebuilt with a 180-day expiry on every deploy: the build stops if a file does not validate, and a check after each deploy fetches the live files and fails if one is invalid or within 45 days of expiry.

Signing

RFC 9116 recommends signing the file with an OpenPGP cleartext signature, together with a Canonical field, so a reader can confirm the file is genuine and meant for the place it was found. This checker recognises a signed file and checks the text inside the signature, but does not verify the signature itself: that needs your public key, and trusting the key is the reader's decision, as the RFC says.

How many sites get it right?

We checked the security.txt of the 10,000 most popular domains with the same code this page uses. The expiry study has the results, including how many published files have already expired.

Frequently asked questions

Is security.txt required?

Not by law in most places, and the RFC does not make it mandatory for anyone to publish one. If you do publish one, Contact and Expires are required for the file to be valid.

What format does Expires use?

An RFC 3339 date-time with a time zone, for example 2027-06-30T23:59:00Z or 2027-06-30T23:59:00+02:00. A plain date such as 2027-06-30 is not valid.

Can I put a plain email address in Contact?

No. The value must be a URI, so an email address is written mailto:[email protected].

Does security.txt on my main domain cover subdomains?

No. A file applies only to the domain in the address used to fetch it. Publish it on each host you want covered, or redirect those hosts' /.well-known/security.txt to one file and list each address in its Canonical field.

What happens after the file expires?

The RFC says its contents are then considered stale and should not be used, so a researcher following the standard may disregard your contact details.