Why this matters
Sooner or later someone will find a security problem in your code. What happens next depends on whether they know where to send it. With no instructions, some people give up. Others open a public issue, which tells attackers about the problem before you have a fix. A security policy is a short document that tells people how to reach you privately.
What good looks like
- A
SECURITY.mdfile in the repository root, or in.github/ordocs/. - A private way to report: an email address, a GitHub private vulnerability report link, or a form.
- A sentence about what the reporter can expect: how quickly you will reply and which versions you fix.
How to do it
- Create
SECURITY.mdat the root of your repository. - Write down how to report a problem privately. Keep it short; a few lines is plenty.
- If your repository is on GitHub, turn on private vulnerability reporting under Settings, then Code security. Link to the "Report a vulnerability" button from your policy.
- Commit the file to your default branch.
A complete policy can be as simple as this:
# Security Policy
## Supported versions
| Version | Supported |
| ------- | ------------------------------------ |
| 3.x | Yes |
| 2.x | Security fixes only until 2027-01-01 |
| < 2.0 | No |
## Reporting a vulnerability
Please do not open a public issue. Email [email protected], or use
"Report a vulnerability" on the Security tab of this repository.
You will get a reply within 3 working days. Once a fix is ready we will
release it, publish an advisory, and credit you unless you prefer otherwise.
Things to watch for
- A policy that points to a public channel. "Open an issue" defeats the purpose. Give a private route.
- An address nobody reads. Use a mailbox that is monitored, or the platform's built-in private reporting.
- Putting the policy only in the README. Tooling and GitHub's Security tab look for a dedicated
SECURITY.mdfile. Keep the README link if you like, but have the file too. - Forgetting to say which versions you support. Reporters need to know whether an old version still counts.