Adding security.txt in 5 minutes — a vulnerability disclosure starter | Scanthra

Scanthra · 6 min read · Updated May 2026

May 2026
TL;DR: Put a short text file at https://yourdomain.com/.well-known/security.txt that says "here's where to email us about a security issue, and how long this info is valid". It's defined by IETF RFC 9116, takes five minutes, costs nothing, and quietly signals to researchers, customers and procurement teams that you take security seriously.

What security.txt actually is

security.txt is a small, machine-readable plain-text file you publish on your website. It is the security world's equivalent of robots.txt: a known location, a simple syntax, and a clear purpose. Its job is to answer one question for someone who thinks they've just found a vulnerability on your site — "who do I tell, and how?"

The format is standardised in IETF RFC 9116 ("A File Format to Aid in Security Vulnerability Disclosure"). It became a Proposed Standard in 2022, so it is no longer a draft or a quirk — it's the agreed way to do this.

Why it matters even if you're not a bank

Three reasons it's worth the five minutes:

The fields RFC 9116 defines

Only Contact and Expires are required. The rest are optional but useful.

A copy-paste sample you can actually use

Replace the email, dates and URLs with your own. Keep the file plain ASCII (no BOM) and use UNIX line endings. Lines starting with # are comments.

# security.txt for example.com
# Please report security issues using the contacts below.

Contact: mailto:security@example.com
Contact: https://example.com/security/report
Expires: 2027-05-01T00:00:00.000Z
Encryption: https://example.com/.well-known/pgp-key.txt
Acknowledgments: https://example.com/security/hall-of-fame
Preferred-Languages: en
Canonical: https://example.com/.well-known/security.txt
Policy: https://example.com/security/policy

Where to put it

The canonical location is:

https://yourdomain.com/.well-known/security.txt

The legacy location /security.txt at the document root is also tolerated by most tools, but the /.well-known/ path is the one RFC 9116 prescribes — use that.

nginx

location = /.well-known/security.txt {
    alias /var/www/example.com/.well-known/security.txt;
    default_type text/plain;
    add_header Cache-Control "public, max-age=3600";
}

Apache

<Files "security.txt">
    ForceType text/plain
    Header set Cache-Control "public, max-age=3600"
</Files>

Just place the file at /var/www/example.com/.well-known/security.txt and make sure Apache is allowed to serve hidden directories (some default configurations block .-prefixed paths).

Static hosts, WordPress, Cloudflare Pages, Vercel, Netlify

Drop a file named security.txt into a folder named .well-known in your public assets directory and redeploy. Most static hosts serve dotfile directories happily; check by visiting the URL right after deployment.

Sign it (optional but tidy)

RFC 9116 allows the file to be a clearsigned PGP message. Most small businesses don't bother — and that's fine. If you already publish a PGP key, signing makes it harder for someone to spoof the file via a compromised host. If you don't, skip it; an unsigned file is perfectly valid.

Common mistakes worth avoiding

How Scanthra detects this

Our M10 robots and well-known probe checks whether /.well-known/security.txt exists and is reachable on the canonical HTTPS URL. If it's missing we surface a low-severity observation rather than a finding — it's a "nice to have, not a wound" — and we include this guide as the suggested fix. Sites that already publish a valid file get a quiet thumbs-up in the compliance map.

Want to know if your site has this issue?

Scanthra runs a friendly, passive check and emails you a plain-English PDF report.

Scan your site free