Safeguard
Developer Tools•

Why can't researchers find your security.txt file?

A security.txt file must be at /.well-known/ over https as text/plain with UTF-8. A troubleshooting checklist for the common hosting mistakes.

Safeguard Security Team
3 min read

Most often the file is in the wrong place or served with the wrong headers. RFC 9116 says it belongs under /.well-known/security.txt, served over https with a Content-Type of text/plain and UTF-8 charset. Check the path, the protocol, the header and any redirects, in that order.

What the RFC specifies

The file belongs under the /.well-known/ path. For legacy compatibility it might also exist at the top level path or redirect to the well known location. If both exist, the /.well-known/ copy takes precedence. Serve it over https, as text/plain, in UTF-8.

That is the whole contract. Everything below is a way to check it.

Checklist

  1. Request https://your-domain/.well-known/security.txt in a browser. Do you see plain text, not a download prompt or an HTML page?
  2. Check the status code. A 200 is what you want. A 404 or a login redirect means a researcher gives up.
  3. Check the Content-Type header. It should be text/plain with charset utf-8.
  4. Check that http redirects to https, not the other way around.
  5. Check each domain and subdomain you want covered. A file on the main site does not necessarily cover another host.
  6. Confirm Contact and Expires are present and that the date has not passed.
  7. If signed, verify the signature on the live copy.

Common causes of failure

SymptomLikely causeFix
404File in the web root only, or the dot directory is blockedCreate the well known path and allow it in the server config
HTML page returnedSingle page app catches every routeAdd a route that returns the file as plain text
Browser downloads the fileWrong Content-TypeSet text/plain with charset utf-8
Works in the browser, fails for toolsBot protection or login in frontExempt the path from challenges
Two different copiesTop level copy out of dateKeep them identical or redirect to the well known copy

Why this affects customer trust

A buyer's security team often checks for this file during review. If it is missing, expired or broken, it suggests that nobody owns disclosure. Since the fix takes minutes, it is worth testing after every deployment change, such as a new CDN or a rewritten router.

Make it part of release checks

Add a small test to your pipeline that fetches the file and verifies the status, header and presence of both required fields. A failing check is cheaper than a researcher who could not reach you. For the date rule, see the Expires field.

Quick check

Does the file have to be under /.well-known/?

That is the standard location. A top level copy or redirect is allowed for legacy compatibility, and the well known copy takes precedence if both exist.

Can I serve it as HTML?

No. The RFC specifies text/plain with a UTF-8 charset.

Safeguard's asset discovery helps teams find the domains and services they run, which is a good starting list for where a security.txt should exist. Try the free scan at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.