Learn/Website

security.txt: publish a security contact

A small text file that tells people who find a security problem on your site how to reach you, and how to keep it valid.

Want this checked on your own domain?

Join the waitlist

Updated

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

  1. 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), so security@example.com is a natural choice.
  2. Write the file. The smallest valid file has one Contact line and exactly one Expires line:
    Contact: mailto:security@example.com
    Expires: 2027-09-30T23:00:00Z
    

    Contact must be a URI: mailto: for email, tel: for phone, or an https:// page (RFC 9116 §2.5.3). You can list several; put the preferred one first. Expires is a date and time with a time zone (Z means 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.
  3. Publish it at /.well-known/security.txt on the host your site uses, such as www.example.com if 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 as text/plain; charset=utf-8 (§3). nginx and Apache serve .txt files as text/plain by default; to add the charset, use charset utf-8; in nginx or AddDefaultCharset utf-8 in Apache. If your website platform doesn’t let you publish files at that path, ask its support how to serve one.
  4. Set a reminder to update Expires before 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.

  1. Check that the contacts in the file still work and reach the right people.
  2. Change Expires to a date less than a year away, for example Expires: 2027-09-30T23:00:00Z.
  3. 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 Contact line. At least one is required (§2.5.3).
  • No Expires line, or more than one. Exactly one is required (§2.5.5).
  • Expires isn’t a full date and time with a time zone. It must follow RFC 3339, for example 2027-09-30T23:00:00Z or 2027-09-30T18:00:00-05:00. A date alone, such as 2027-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)

FieldRequiredValue
ContactYes, one or moreURI: mailto:, tel:, or https://; listed in order of preference
ExpiresYes, exactly onceRFC 3339 date-time; recommended less than a year ahead
EncryptionNoURI of an encryption key (never the key itself)
AcknowledgmentsNohttps:// page thanking researchers
CanonicalNohttps:// URIs where this file is published
PolicyNohttps:// page with your disclosure policy
HiringNohttps:// page with security jobs
Preferred-LanguagesNo, at most onceComma-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, with Content-Type: text/plain and the charset set to utf-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.

FindingCondition
No security contact (informational)The final response isn’t status 200 with a text/plain content type
IncompleteNo 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)
ExpiredThe Expires date and time is now or in the past
PublishedAt 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

Want this checked on your own domain?

Join the waitlist
Domain Readiness

Free checks for email, website, DNS, and registration, with plain-English fixes.

Domain Readiness™ (domainreadiness.com) is a service of Riviera Learning, LLC.