Guides / Process

security.txt and handling vulnerability reports for your own app

beginnerUpdated 26 Nov 2026831 words

Sooner or later someone finds a security problem in your site or app and wants to tell you. If they cannot find a contact, they give up, post it publicly, or send it to an address nobody reads. A security.txt file tells them where to write, and a short process makes sure the report leads to a fix. Both fit a small team or a single developer.

The security.txt file

RFC 9116 (April 2022) defines a plain text file at a fixed path:

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

It must be served over HTTPS with Content-Type: text/plain; charset=utf-8. A file at /security.txt is allowed for older tools, but the one under /.well-known/ wins. Each file applies only to the host it is served from, not to subdomains.

A minimal file:

Contact: mailto:security@example.com
Expires: 2027-11-30T23:00:00Z
Preferred-Languages: en, de
Policy: https://example.com/security-policy
Canonical: https://example.com/.well-known/security.txt

The fields:

Field Required Meaning
Contact yes, at least one mailto:, tel: or an https:// URL of a form
Expires yes, once only date after which the file should not be trusted; the RFC recommends less than a year ahead
Encryption no a link to your OpenPGP key (never the key itself)
Policy no your disclosure policy
Acknowledgments no a page thanking reporters
Preferred-Languages no languages you read
Canonical no the URLs where this file is published
Hiring no security jobs

All web URLs in the file must start with https://. The RFC recommends signing the file with an OpenPGP cleartext signature. Put a reminder in your calendar a month before Expires: an expired file tells researchers the contact may be dead.

Serve it

nginx:

location = /.well-known/security.txt {
    alias /var/www/security.txt;
    default_type text/plain;
    charset utf-8;
}

Caddy:

handle /.well-known/security.txt {
	root * /var/www
	rewrite * /security.txt
	header Content-Type "text/plain; charset=utf-8"
	file_server
}

Check it:

curl -s -D - https://example.com/.well-known/security.txt | grep -i -E '^(content-type|contact|expires)'
content-type: text/plain; charset=utf-8
Contact: mailto:security@example.com
Expires: 2027-11-30T23:00:00Z

Make sure the contact address works: send a test mail to it from an outside account, and check that it does not land in a spam folder nobody reads.

A disclosure policy in five sentences

The Policy page does not need lawyers. Say:

  1. how to report (the contact, what to include: steps to reproduce, affected URL or version);
  2. what you will do: acknowledge within a few working days and keep the reporter informed;
  3. what is out of scope (denial of service tests, social engineering, accounts of other users);
  4. that you will not take legal action against good-faith research within these rules;
  5. whether you pay rewards (it is fine to say no) and whether you credit reporters.

Handling a report

Acknowledge quickly, even if only to say you received it and will look. A reporter who hears nothing does not have a reason to wait.

Reproduce and assess. Can you trigger it? What can an attacker do with it, and who is affected? A CVSS vector is a useful way to write the assessment down, even if you do not publish it.

Check for use. If the bug could have been used against your users, look at logs for signs of it. If data may have been exposed, the reporting duties in the first hour of a security incident can apply.

Fix, then tell. Agree a disclosure date with the reporter. Release the fix, then publish what was wrong, which versions are affected, which version fixes it and who reported it.

Do not punish the reporter. Requests to keep quiet until a fix exists are fair. Threats are not, and they become the story.

When to request a CVE

A CVE ID helps when other people run your software: a library, a self-hosted app, a plugin. Their scanners can only warn them if there is an ID. For a bug in a website only you operate, a CVE is not needed.

Ways to get one:

  • GitHub repositories: create a draft security advisory in the repository (Security tab) and request a CVE from it. GitHub is a CNA and assigns the ID; the advisory also goes into the GitHub Advisory Database, so dependency scanners pick it up.
  • Projects with their own CNA (many larger projects and vendors): ask that CNA.
  • Otherwise: request one from MITRE through the CVE request form at https://cveform.mitre.org/.

The guide what is a CVE explains CNAs and records.

Sources

Check your servers every day

The agent of Patchbrief reports the packages and settings of a server once a day; the digest names what to fix first.

Start free