The Architecture and Rationale of RFC 9116 (security.txt)
When independent security researchers, academic penetration testers, or ethical bug bounty hunters discover zero-day vulnerabilities in public web applications, their initial challenge is rarely technical—it is organizational. For decades, security researchers attempting to responsibly disclose vulnerabilities were forced to tweet at corporate accounts, submit generic contact forms, or guess unmonitored aliases like [email protected] or [email protected]. In worst-case scenarios, sensitive reports containing remote code execution (RCE) or SQL injection exploits were forwarded to non-technical support staff, exposing the report to internal leaks or complete inaction.
In April 2022, the Internet Engineering Task Force (IETF) ratified RFC 9116: A File Format to Aid in Security Vulnerability Disclosure. Spearheaded by security researcher EdOverflow and Google security engineer Yakov Shafranovich, RFC 9116 establishes a standardized, machine-readable text file hosted at /.well-known/security.txt that clearly delineates who to contact, how to encrypt disclosures, and what legal protections (Safe Harbor) apply to ethical research.
Comprehensive RFC 9116 Directive Reference
The specification defines eight standardized directives. Each line consists of a case-insensitive field name followed by a colon (:) and whitespace-separated parameter value:
| Directive | Requirement Level | Value Scheme | Description & Purpose |
|---|---|---|---|
| Contact | Mandatory (>= 1) | mailto:, https://, tel: | Primary address or web form for submitting vulnerability reports. Can appear multiple times. |
| Expires | Mandatory (= 1) | ISO 8601 UTC timestamp | The exact point in time after which the data in the file must be considered invalid and stale. |
| Encryption | Optional | https://, openpgp4fpr: | Link to the organization's public OpenPGP key to enable end-to-end encrypted vulnerability triage. |
| Acknowledgments | Optional | https:// | Link to a public "Hall of Fame" recognizing security researchers who reported valid issues. |
| Canonical | Optional | https:// | The authoritative canonical URI for the file, preventing MITM injection across secondary mirrors. |
| Policy | Optional | https:// | Link to the Vulnerability Disclosure Policy (VDP) outlining safe harbor guidelines and scope. |
| Hiring | Optional | https:// | Link to security career openings, targeting security talent reading your infrastructure files. |
| Preferred-Languages | Optional | Comma-separated RFC 5646 codes | Languages in which the security team can review reports (e.g., en, de, fr, es). |
The Mandatory 'Expires' Header: Combating Stale Contact Data
Unlike robots.txt, which remains valid indefinitely until updated, RFC 9116 enforces an explicit Expires directive. The security rationale is straightforward:
RFC 9116 Freshness and Key Revocation
Corporate restructurings, team turnover, and PGP key expirations frequently leave web contacts obsolete. If a security researcher encrypts an urgent remote zero-day using an expired PGP key whose private key was lost or rotated, the report becomes unrecoverable. Automated scanning tools and bounty platforms reject any security.txt whose Expires timestamp has passed.
RFC 9116 recommends that organizations automate their security.txt rotation in CI/CD pipelines, bumping the expiration timestamp dynamically while enforcing a validity window of less than 365 days.
Web Server Deployment and MIME Type Requirements
To conform with RFC 9116 §3, web server administrators must adhere to four strict infrastructure requirements:
- Mandatory Path: The primary authoritative file MUST be accessible at
https://<domain>/.well-known/security.txt. - Enforce HTTPS: The file MUST be served over TLS/HTTPS with a valid, trusted certificate. Cleartext HTTP requests must return an HTTP 301 or 308 redirect to the HTTPS endpoint.
- MIME Type: The web server must return the HTTP header
Content-Type: text/plain; charset=utf-8. Returningtext/htmlorapplication/octet-streamviolates the standard. - No Access Controls: The file must be publicly readable without requiring HTTP basic authentication, CAPTCHAs, cookie banners, or IP whitelists.
Web Server Configuration Snippets
1. Nginx Configuration (/etc/nginx/sites-available/default)
location = /.well-known/security.txt {
default_type text/plain;
charset utf-8;
add_header Access-Control-Allow-Origin "*";
alias /var/www/html/.well-known/security.txt;
} 2. Apache HTTP Server (.htaccess / httpd.conf)
<IfModule mod_mime.c>
<Files "security.txt">
ForceType text/plain
Header set Access-Control-Allow-Origin "*"
</Files>
</IfModule> Cryptographic Integrity: Clear-Signing with OpenPGP
Because security.txt informs external researchers where to send vulnerability disclosures, an attacker who compromises your DNS, CDN cache, or HTTP server could replace your security email with a rogue address to intercept zero-day disclosures.
RFC 9116 §2.3 resolves this threat by supporting OpenPGP clear-text signatures (RFC 4880). Signing the file embeds an immutable cryptographic verification block:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Contact: mailto:[email protected]
Expires: 2027-11-01T15:00:00.000Z
Encryption: https://example.com/pgp-key.txt
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE...
-----END PGP SIGNATURE----- Client-Side Privacy Guarantee
Security contact information, private PGP key URLs, and internal vulnerability policies should never be exposed to third-party cloud generation services. 2ClickKit executes 100% inside your local browser memory. No email addresses, phone numbers, or domain URLs are ever uploaded to any server.