Key facts
- The format is defined in RFC 9116, an informational specification published in April 2022.
- The file must be at
/.well-known/security.txtand must be served over HTTPS. - Two fields are required:
Contact, andExpires, which appears once. - A file applies only to the domain or address it was fetched from, not to its subdomains.
- Its presence or absence neither grants nor denies permission to test.
- The specification is informational. The National Cyber Security Centre recommends publishing one.
Look the file up
In a browser, visit https://example.co.uk/.well-known/security.txt. From a command line:
curl -sS https://example.co.uk/.well-known/security.txt
A typical file looks like this:
Contact: mailto:security@example.co.uk
Contact: https://example.co.uk/report-a-vulnerability
Expires: 2027-06-30T23:59:59Z
Policy: https://example.co.uk/security-policy
Preferred-Languages: en
Canonical: https://example.co.uk/.well-known/security.txt
A "not found" answer means no file is published at that address. Some websites answer every unknown address with an ordinary web page, so check that what comes back is plain text in this format and not the site's own error page. Follow a redirect only with care: the specification asks researchers to check where a redirect leads before trusting the file.
Read the fields
| Field | Required | Meaning |
|---|---|---|
Contact |
Yes | Where to send a report, such as an email address or a web form. May appear several times, in order of preference |
Expires |
Yes, once | The date after which the file's contents are to be treated as stale |
Policy |
No | A link to the organisation's vulnerability disclosure policy |
Encryption |
No | A link to a key for sending an encrypted report |
Acknowledgments |
No | A link to a page thanking people who have reported problems |
Preferred-Languages |
No | The languages in which reports are welcome |
Canonical |
No | The address or addresses at which this file is meant to be found |
Hiring |
No | A link to the organisation's security vacancies |
A reader ignores any field it does not recognise, so a file may carry others.
Check that it is current
Read the Expires date first. The specification recommends a date less than a year ahead, so that
the file is revisited at least annually, and says that data past its expiry date should not be used.
It goes further: having no file may be better than having a stale one, because a stale contact sends
a report nowhere.
If the file has a Canonical field and the address you fetched it from is not listed there, the
specification says the contents should not be trusted. A file may also be signed. The signature is
recommended, not required, and deciding whether to trust the key is left to the reader.
One file per host
A file applies only to the domain or address in the URL it was fetched from. A file on
example.co.uk says nothing about shop.example.co.uk, and the reverse. This is why the National
Cyber Security Centre's guidance is to publish the file on all of an organisation's domains and
subdomains.
It also means a check of one domain is a check of one domain. An organisation with twenty domains may have a file on two of them.
What the file tells you, and what it does not
It tells you that a route for security reports has been published on that host, where that route is, and the date until which the publisher says it holds good.
It does not tell you:
- whether reports are read or acted on;
- whether the organisation has a disclosure policy, unless the file links to one;
- anything about the security of the site or the organisation behind it;
- that you may test the site. The specification is explicit that the file gives no permission, and testing a system without its owner's permission can be an offence under the Computer Misuse Act 1990.
No file is not a finding against a company. An expired file, or a contact address that no longer works, is a more useful observation, because it suggests a process that was started and not kept up.
Attaching the reading to a company
Whether a host publishes a security.txt file is a fact about that host on the day you looked. Attaching it to a legal entity is a separate step, and it depends on the evidence that the company operates that domain. Note the date with the reading: the file is designed to expire, so the same check will give a different answer later.
This page is general information, not legal advice. The legislation cited was checked when it was written; check the current text before relying on it.
Questions
Where is a security.txt file found?
At /.well-known/security.txt on the website, served over HTTPS. Some sites also keep a copy at /security.txt for older tools. If both exist, the one under /.well-known/ is the one to use.
Is security.txt a legal requirement in the UK?
The format is an informational internet specification, RFC 9116, published in 2022, and not a legal instrument. The National Cyber Security Centre recommends it as part of a vulnerability disclosure process. We know of no general legal duty on UK companies to publish one.
Does a security.txt file give permission to test a website?
No. The specification says its presence or absence neither grants nor denies permission for security testing. Any permission is set out in the organisation's own disclosure policy, if it has one. Testing without permission can be an offence under the Computer Misuse Act 1990.
Does having no security.txt mean a company has poor security?
No. It means the company has not published a contact in this format. An organisation may take reports another way. The absence is a fact about one file, not a measure of the company.
Does a file on the main domain cover its subdomains?
No. Under the specification a file applies only to the domain or address it was fetched from, not to subdomains or parent domains. Each host needs its own file.
The UK Business Cyber Risk Register
Observes records dated, externally observable facts about .uk domains: DNS records, mail authentication records and TLS certificates, each with the date it was observed. Not an official register, and not a rating. Company-to-website links: In evaluation. None is served until a pre-registered accuracy test has been passed.
Sources
- RFC 9116: A File Format to Aid in Security Vulnerability Disclosure: section 3: location and HTTPS; section 2.5: the fields; section 3.1: scope; section 5.3: stale files; section 5.5: no implied permission for testing
- National Cyber Security Centre: Vulnerability Disclosure Toolkit: UK guidance to publish security.txt on all of an organisation's domains and subdomains
- Computer Misuse Act 1990, section 1: unauthorised access to computer material