A security.txt File: A Five-Minute Way to Let People Report Problems
Short answer: A security.txt file is a plain text file that tells security researchers how to report a problem with your website or app. Put it at the path /.well-known/security.txt, served over HTTPS. It needs at least two lines: a Contact address or link, and an Expires date no more than a year ahead. Add a preferred language and a policy link if you have them. Once it is live, check that the address behind Contact is read by someone who will reply. The whole job takes about five minutes, and it is far easier than working out where a report went after it was posted publicly.
Why a small site needs a front door
Many people find flaws by accident: a form that shows another customer's order, a page that accepts a script it should not, a forgotten test server with a default password. When they cannot find a way to report it, they sometimes post it publicly, or they give up. A security.txt file gives them a documented route. It costs nothing to publish and it signals that you read reports.
The file follows RFC 9116, a standard published by the IETF. It is deliberately minimal, which is why a small business can write it without help.
The fields that matter
A minimal file looks like this:
Contact: mailto:security@example-bakery.ca
Expires: 2027-10-31T12:00:00Z
Preferred-Languages: en, fr
Policy: https://example-bakery.ca/security-policy
The example domain and dates are placeholders. Replace them with your own, and note these rules:
- Contact is required. Use a mailto address, a telephone number with a country code, or a web page with a reporting form. Use an address that a person checks, not a no-reply mailbox.
- Expires is required. Set a date no more than a year away, and update the file before it passes. An expired file is treated as unreliable.
- Preferred-Languages is optional. List the languages your team can answer in, using standard language codes.
- Policy is optional but useful. It links to a short page explaining what you consider in scope and how you will respond.
Do not put sensitive information in the file. Anyone can read it, and it should contain only the public route for reports.
Where the file must live
Serve the file at /.well-known/security.txt on your main domain. Some researchers also check the root path, /security.txt, so you can publish a copy there too, as long as the two files are identical. The file must be served over HTTPS, with a plain text content type, and it must return a normal success code. A redirect to another domain is not reliable.
For a static site, put the file in the folder that becomes the public root. For a content management system, use the upload or static files option in the admin area, or ask the host to place it. After you publish, open the address in a private window and confirm the text appears without any login.
Choose who reads the inbox
The mailbox behind Contact should be a shared address, such as security@ or a reports queue, not a person's personal inbox. Two or three people should have access, so one holiday does not leave reports unread. Set an auto-reply that confirms receipt and gives an expected response time. A short internal note should say who owns each step: triage, a fix, a notice to customers if personal data was involved.
A short reply template
Keep a template for incoming reports so the first reply is quick and calm:
Thank you for telling us about this. We have received your report and are checking it now. Please do not share the details publicly while we investigate. We will reply within three working days with what we have found. If you have a proof of concept, please send only the minimum needed to show the problem.
Adjust the timeline to what your team can meet. Promising a response you cannot keep is worse than promising a longer one.
Check and maintain
Test the file with an online validator or a simple command that fetches the address and prints the response. Put the expiry date in your calendar with a reminder a month ahead. When staff change, update the Contact line and the mailbox access the same day. A file that points to a former employee's address is a quiet failure that nobody notices until a report goes missing.
Keep the file accurate as the site changes
A security.txt file goes stale quietly. The mailbox moves to a new provider, a staff member leaves, or the company changes its domain, and the file keeps pointing at the old place. Add a checklist item to any handover of the website or the mailbox: update the Contact line, the Policy link and the Expires date, then fetch the file once from outside your network.
Keep the file free of internal details. Do not list staging hostnames, internal ticket systems or the names of contractors who built the site. Those details help an attacker more than a researcher, and they are not needed for a report to reach you.
FAQ
Do I need a security.txt if I only run a simple brochure site?
It is still useful. Even a brochure site has a contact form and a server, and both can have flaws. The file costs little and sets expectations for anyone who finds a problem.
Does a security.txt file invite hackers to attack me?
It does not reveal anything they could not find themselves. It only tells them where to send a report, which tends to reduce public disclosure.
What if someone reports a problem that is not real?
Thank them, check the report with the same care as any other, and reply with what you tested. Keep a record so you can recognise repeat submissions.
Can I use a web form instead of an email address?
Yes, as long as the form uses HTTPS and the Contact line points to its address. Make sure the form is monitored as carefully as the mailbox.
If you want help setting up the file, the reply process or a basic review of your forms, contact our studio and we will work through it with you.