security.txt
| Defined in | RFC 9116 (April 2022), informational |
|---|---|
| Location | /.well-known/security.txt, over HTTPS |
| Media type | text/plain; charset=utf-8 |
| Required fields | Contact (one or more), Expires (exactly one) |
| Field registry | IANA, security.txt Fields |
A researcher who finds a flaw on example.com and wants to reach the owner can request https://example.com/.well-known/security.txt. If the site publishes one, the response is a short plain-text list of fields: where to send the report, which key to encrypt it with, and where the disclosure policy lives. Edwin Foudil and Yakov Shafranovich defined the format in RFC 9116, a document the Internet Engineering Task Force published in April 2022, because people who found a vulnerability often had no channel to report it.1 It is published for information and is not an internet standard.1
Location and scope
The file has to sit under /.well-known/, be fetched over HTTPS and be sent with the content type text/plain; charset=utf-8, which marks it as plain text in UTF-8. For older tools, a copy or a redirect at the top-level path /security.txt is allowed. When both locations hold a file, the one under /.well-known/ wins.1
A file covers only the exact host or IP address it was fetched from. The file on example.com says nothing about shop.example.com or about a parent domain, so each subdomain that should have a contact needs its own copy. An organisation may add that the file also applies to its products and services.1
Format and fields
Each line is a field name, a colon, a space and a value. Lines that start with # are comments, and a line may end in CRLF or in LF alone. The order of fields carries no meaning, except that repeated Contact lines are read in order of preference.1
| Field | How often | Value |
|---|---|---|
Contact | One or more | A mailto:, tel: or https:// link; the first is the preferred channel |
Expires | Exactly one | A date and time in RFC 3339 format, such as 2027-10-31T23:00:00Z, after which the file is stale |
Encryption | Any | Where to find a key: a web address, a dns: OPENPGPKEY record or an openpgp4fpr: fingerprint. Never the key itself |
Canonical | Any | The https:// addresses where this file is meant to be served |
Policy | Any | A link to the vulnerability disclosure policy |
Acknowledgments | Any | A page that credits researchers who reported flaws |
Preferred-Languages | At most one | Language tags separated by commas, such as en, es, fr |
Hiring | Any | An https:// page listing security jobs |
New fields go through an IANA registry, and readers treat every registered field as optional.1 The registry, opened in July 2021, holds two additions: CSAF, which points to a provider's metadata file under the Common Security Advisory Framework, and Bug-Bounty, set to True or False to say whether reports can earn money through a bug bounty.2
Expiry
The Expires field exists because contact details rot. A report sent to a mailbox nobody reads is lost, and one sent to the wrong contact can expose the flaw to a third party. The RFC asks for a date under a year ahead and says that having no file may be better than having a stale one.1 Google's file, as served in November 2026, sets Expires to 1 April 2030, more than three years away.3 Moving the date forward each year is one of the tasks in Security maintenance after launch.
Trust and signing
Whoever controls the web server controls the file. An attacker inside a site can rewrite security.txt or redirect it to their own server, so that reports reach them and not the owner (see Responding to unauthorised changes to a website).1 The RFC offers two defences. A file fetched from an address that none of its Canonical lines names should not be trusted. The file can also be wrapped in an OpenPGP cleartext signature, a block of signature text placed around the file by encryption software such as GnuPG; once signed, the Canonical lines are covered by the signature, which then vouches for where the file belongs.1 A cleartext signature leaves the text readable as it is, and OpenPGP software is needed only to check it. GnuPG produces one with gpg --clear-sign security.txt.4 The key named under Encryption is not assumed to be the signing key.1
Researchers who read the file take risks too. A redirect while fetching the file, or any page it links to, can lead to a domain an attacker runs, so researchers are told to record redirects and inspect them. A hostile site can serve a huge or malformed file to attack the parser; tools may refuse files over 32 KB, fields over 2,048 characters or files over 1,000 lines.1 Where many users publish pages under one domain, one of them could claim either path, and the operator should reserve both names.1
Limits of the file
Publishing security.txt does not authorise anyone to test the site. Permission for testing belongs in the policy the file links to, or in a field defined for that purpose (see Penetration testing).1 A published address also draws automated scanner output and spam, and the RFC leaves each organisation to weigh that load against the reports it gains.1 Answering what arrives is covered in Handling a vulnerability report.
US federal agencies follow a different rule. BOD 20-01, the September 2020 directive that made them publish disclosure policies, fixed the path /vulnerability-disclosure-policy on each agency's main .gov site for the policy itself and required a security contact in the .gov domain registrar.5
Adoption and common errors
The monitoring vendor URIports found the file on 12,510 of the top one million domains in 2025, or 1.25%, up from 0.7% in April 2024. Of those files, 44% met the RFC.6 The report names Expires as the main stumbling block: 45% of files had none, 13% carried a date already past and 20% a date too far ahead. About one file in ten spelled the field Acknowledgements with an e, and 26% had Canonical lines that did not match the address the file came from.6
Publishing the file
A Next.js project serves anything in its public folder from the site root, so public/.well-known/security.txt appears at /.well-known/security.txt.7 A minimal file with a policy link and a canonical address:
Contact: mailto:security@example.com
Expires: 2027-10-31T23:00:00Z
Policy: https://example.com/security-policy
Canonical: https://example.com/.well-known/security.txtAfter deploying, open the address in a browser and check in the developer tools that the response is text/plain and that the Canonical line matches the address in the bar. The step sits in Security checklist before launch.
See also
- Handling a vulnerability report
- Bug bounty program
- Penetration testing
- Security checklist before launch
- Security maintenance after launch
- Category: Incident response
References
- a b c d e f g h i j k l m n Foudil, E.; Shafranovich, Y. (April 2022). "RFC 9116: A File Format to Aid in Security Vulnerability Disclosure". IETF.
- back IANA (created 13 July 2021, updated 7 March 2026). "security.txt Fields". Internet Assigned Numbers Authority.
- back Google. security.txt (retrieved 22 November 2026). google.com.
- back "Operational GPG Commands". Using the GNU Privacy Guard. GnuPG.
- back CISA (2 September 2020). "BOD 20-01: Develop and Publish a Vulnerability Disclosure Policy". Cybersecurity and Infrastructure Security Agency.
- a b URIports (2025). "Follow-Up on Security.txt Adoption: Progress and Pitfalls in 2025". URIports blog.
- back "public Folder" (updated 16 June 2025). Next.js Docs. Vercel.
External links
- File Format Description and ABNF Grammar, RFC 9116, section 4