Skip to content
SEO Optimizer is live, Audit on page SEO and AI-search readiness. Try it free
Security

What Is security.txt? RFC 9116 With an Example

·5 min read

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.txt at the root, ideally as a redirect to the .well-known file.
  • It must be served over HTTPS with a text/plain content 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

.well-known/security.txtA complete security.txt file
Contact: mailto:security@example.com
Contact: https://example.com/security/report
Expires: 2027-10-31T23:59:59Z
Encryption: https://example.com/pgp-key.txt
Preferred-Languages: en, de
Canonical: https://example.com/.well-known/security.txt
Policy: https://example.com/security/disclosure-policy
Acknowledgments: https://example.com/security/hall-of-fame

The security.txt Fields

FieldRequired?What it does
ContactYes, at least oneAn email (mailto:), web form URL or phone number (tel:) for reports. List them in order of preference.
ExpiresYes, exactly onceDate after which the file should be treated as stale. RFC 9116 recommends less than a year ahead.
EncryptionNoLink to a public key for encrypted reports.
PolicyNoLink to your vulnerability disclosure policy: scope, safe harbor, what to expect.
AcknowledgmentsNoPage thanking researchers who reported issues.
Preferred-LanguagesNoLanguages your team can read reports in.
CanonicalNoThe URL where this file officially lives, useful if the file is signed.
HiringNoLink 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 Expires date. An expired security.txt should be treated as stale, so researchers may ignore it. Put a reminder in your calendar to renew it.
  • No Contact field, 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 .env and .git must 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.

FAQ

Questions fréquentes

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.

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