security.txt: publish a security contact
Want this checked on your own domain?
Join the waitlistUpdated
Message for whoever manages your website
Hi, could you publish a security.txt file on our website at /.well-known/security.txt? It should list our security contact (for example, an email address that someone monitors) and an “Expires” date less than a year from now. Please also set a reminder to update the date before it passes. Thank you.
Want this checked on your own domain? Join the waitlist.
Check yours
Run the full report (join the waitlist for access) on your domain. Its website section checks for the file and validates the two required fields.
Fix it
- Choose a contact that someone reads: an email address, a web page with a contact form, or both. The standard points to the
security@mailbox convention (RFC 9116 §2.5.3, RFC 2142 §4), sosecurity@example.comis a natural choice. - Write the file. The smallest valid file has one
Contactline and exactly oneExpiresline:Contact: mailto:security@example.com Expires: 2027-09-30T23:00:00ZContactmust be a URI:mailto:for email,tel:for phone, or anhttps://page (RFC 9116 §2.5.3). You can list several; put the preferred one first.Expiresis a date and time with a time zone (Zmeans UTC), and the standard recommends keeping it less than a year ahead (§2.5.5). The generator at securitytxt.org, by the standard’s authors, produces a valid file. - Publish it at
/.well-known/security.txton the host your site uses, such aswww.example.comif the bare domain redirects there. A security.txt file applies only to the exact host it’s served from (§3.1), so if both hosts serve your site, publish it on both. Serve it over HTTPS astext/plain; charset=utf-8(§3). nginx and Apache serve.txtfiles astext/plainby default; to add the charset, usecharset utf-8;in nginx orAddDefaultCharset utf-8in Apache. If your website platform doesn’t let you publish files at that path, ask its support how to serve one. - Set a reminder to update
Expiresbefore it passes.
Check: open https://example.com/.well-known/security.txt in a browser (with your domain); you should see the plain text file, not a web page. Then run the report again.
No security contact (security.txt)
This is informational. We didn’t find a security.txt file at /.well-known/security.txt on the host your homepage uses, or the address didn’t answer with a plain-text file. The second case also happens when a site answers unknown addresses with an HTML page instead of a “not found” error. Follow the steps above to add one.
security.txt has expired
The date in the file’s Expires line has passed. The standard says the contents should then be treated as stale and not used (§2.5.5), and that having no file may be better than having stale information (§5.3). Researchers may not trust the contact details.
- Check that the contacts in the file still work and reach the right people.
- Change
Expiresto a date less than a year away, for exampleExpires: 2027-09-30T23:00:00Z. - Set a reminder to update it again before that date.
Check: run the report again; it shows the security contact as published.
security.txt is incomplete
The file exists but is missing something the standard requires. One of these applies:
- No
Contactline. At least one is required (§2.5.3). - No
Expiresline, or more than one. Exactly one is required (§2.5.5). Expiresisn’t a full date and time with a time zone. It must follow RFC 3339, for example2027-09-30T23:00:00Zor2027-09-30T18:00:00-05:00. A date alone, such as2027-09-30, isn’t valid.
Field names aren’t case-sensitive, and each field goes on its own line as Name: value (§2). Lines starting with # are comments.
Check: run the report again; it shows the security contact as published.
Technical reference
Fields (RFC 9116 §2.5)
| Field | Required | Value |
|---|---|---|
Contact | Yes, one or more | URI: mailto:, tel:, or https://; listed in order of preference |
Expires | Yes, exactly once | RFC 3339 date-time; recommended less than a year ahead |
Encryption | No | URI of an encryption key (never the key itself) |
Acknowledgments | No | https:// page thanking researchers |
Canonical | No | https:// URIs where this file is published |
Policy | No | https:// page with your disclosure policy |
Hiring | No | https:// page with security jobs |
Preferred-Languages | No, at most once | Comma-separated language tags, such as en, es |
Researchers must ignore fields they don’t support (§2.4).
Location and serving (§3)
- Web services must place the file under
/.well-known/. A copy at the top-level path (/security.txt) or a redirect to the/.well-known/file is allowed for older tools; if both exist, the/.well-known/one wins. - It must be fetched over
https, withContent-Type: text/plainand the charset set toutf-8. - Redirects are allowed; researchers should check where they lead (§5.2).
- Scope: the file applies only to the domain or IP address in the URL used to fetch it, not to its subdomains or parent domain (§3.1).
Signing (§2.3)
Signing is optional. The standard recommends an OpenPGP cleartext signature, and with it a Canonical field so the signature also vouches for where the file belongs. If Canonical is present and the address you fetched isn’t listed in it, the file shouldn’t be trusted (§2.5.2).
What the report checks
We request https://<host>/.well-known/security.txt, where <host> is the host your secure homepage ends up on, and follow redirects. We skip this check if the site has no working secure homepage.
| Finding | Condition |
|---|---|
| No security contact (informational) | The final response isn’t status 200 with a text/plain content type |
| Incomplete | No Contact line; zero or several Expires lines; or an Expires value that isn’t an RFC 3339 date and time with a time zone (T and Z may be lowercase, as in RFC 9116’s own example) |
| Expired | The Expires date and time is now or in the past |
| Published | At least one Contact and a single, future Expires |
We read field names without regard to case and skip comment lines. We don’t check the contact URIs’ format, the charset, or signatures.
Sources
- RFC 9116, A File Format to Aid in Security Vulnerability Disclosure
- RFC 2142, Mailbox names for common services (§4)
- RFC 3339, Date and Time on the Internet (§5.6)
- securitytxt.org, security.txt generator by the RFC 9116 authors
- nginx, default MIME types (mime.types)
- nginx, ngx_http_charset_module
- Apache HTTP Server, AddDefaultCharset
Want this checked on your own domain?
Join the waitlist