What Is security.txt? RFC 9116 With an Example
When a security researcher finds a vulnerability on your website, they need to know who to tell. Without a clear contact, the report goes to a general support inbox, gets lost, or never gets sent. security.txt fixes that. It is a small plain-text file at a fixed address on your domain that says how to report security issues. It is defined in RFC 9116, takes five minutes to set up, and is checked by researchers, bug bounty platforms and security scanners.
What Is security.txt?
security.txt is to vulnerability reports what robots.txt is to crawlers: a standard file in a standard place that machines and people know to look for. The format was published as RFC 9116 in April 2022. The file lists one or more contact methods, an expiry date, and optional links to your disclosure policy, encryption key and acknowledgments page.
Where the security.txt File Goes
- The main location is
https://example.com/.well-known/security.txt. - For older tools you can also serve
/security.txtat the root, ideally as a redirect to the.well-knownfile. - It must be served over HTTPS with a
text/plaincontent type. - Each domain and subdomain that runs its own service can have its own file. If not, at least publish one on your main domain.
A security.txt Example
The security.txt Fields
| Field | Required? | What it does |
|---|---|---|
Contact | Yes, at least one | An email (mailto:), web form URL or phone number (tel:) for reports. List them in order of preference. |
Expires | Yes, exactly once | Date after which the file should be treated as stale. RFC 9116 recommends less than a year ahead. |
Encryption | No | Link to a public key for encrypted reports. |
Policy | No | Link to your vulnerability disclosure policy: scope, safe harbor, what to expect. |
Acknowledgments | No | Page thanking researchers who reported issues. |
Preferred-Languages | No | Languages your team can read reports in. |
Canonical | No | The URL where this file officially lives, useful if the file is signed. |
Hiring | No | Link to security jobs. |
You can also sign the file with OpenPGP so readers can confirm it was not tampered with. That is optional, and most small sites skip it.
Write a Disclosure Policy Too
A contact address tells people where to report. A short disclosure policy linked from the Policy field tells them how: which domains are in scope, what testing is not allowed (for example denial of service or social engineering), how quickly you will reply, and that you will not take legal action against good-faith research. Even a few paragraphs make researchers far more likely to report to you rather than post publicly.
Common security.txt Mistakes
- A missing or expired
Expiresdate. An expired security.txt should be treated as stale, so researchers may ignore it. Put a reminder in your calendar to renew it. - No
Contactfield, or one that points to an inbox nobody reads. Use a shared address, not a person who might leave. - Served as HTML. Some frameworks return the normal app page for any unknown path. Make sure the file is real plain text.
- Blocked by a dotfile rule. Rules that hide
.envand.gitmust allow/.well-known/, or your security.txt will return 404. - Only on HTTP or only at the root path.
How to Check Your security.txt
Open https://yourdomain.com/.well-known/security.txt in a browser and check it shows as plain text. A security scan also looks for the file at both /.well-known/security.txt and /security.txt. It ignores HTML pages that a site returns for every path, and reports when the file is missing, when it has no Contact field, or when its Expires date has passed. It is a low-severity finding, but it is one of the easiest to fix, and it shows researchers you take reports seriously. See how to read a security scan report for how findings are graded.
Summary
Add a security.txt file to /.well-known/ with a working contact and an expiry date less than a year away, link a short disclosure policy, and renew it every year. It costs nothing and turns accidental discoveries into reports you can act on.
Preguntas frecuentes
security.txt is a plain-text file at /.well-known/security.txt that tells security researchers how to report vulnerabilities to you. Its format is defined in RFC 9116.
RFC 9116 requires at least one Contact field and exactly one Expires field. Encryption, Policy, Acknowledgments, Preferred-Languages, Canonical and Hiring are optional.
At https://yourdomain.com/.well-known/security.txt, served over HTTPS as text/plain. You can also redirect /security.txt at the root to it for older tools.
Before the Expires date passes. RFC 9116 recommends setting Expires less than a year ahead, so review the file at least once a year.
It is not a legal requirement for most sites, but it is a widely used standard, and some government and industry guidelines recommend it. It costs little and helps you receive vulnerability reports.
Related reading
How to Read a Website Security Scan Report
Severity ratings, CVSS scores, and a findings list that looks alarming at first glance - a practical guide to triaging a security scan report without panicking or ignoring it.
Website Security Headers Explained: The Complete Checklist
CSP, HSTS, X-Frame-Options, and every other HTTP security header your site should ship - with copy-pasteable examples.
Understanding the OWASP Top 10 for Website Owners (Not Just Developers)
The industry's most-cited security list, translated out of developer jargon - what each category actually means for a site you own but didn't build yourself.
How to Fix an Exposed .env File
If your .env file is publicly accessible, every secret in it is compromised. How to block it, rotate the keys, check for abuse and stop a .env file exposed again.
Security Scan
Checks security.txt, headers, TLS, DNS and exposed files.
Find out which headers you're missing
Run a free security scan and get a plain-English breakdown of every header, cert, and exposed secret.
Run a free security scan