Security
How to tell us about a security issue, the keys we sign with, and how Sandcastle is kept secure. If you want to know whether the packages and metadata on your system actually came from us, the keys below are the list you check them against.
The guide for that is over at Verifying the Sandcastle signatures: what each key does, the commands that check them, the older keys, and what to do when something doesn't line up.
Reporting a security issue
For security issues, please contact me at
security@foo-projects.org. Please don't file them in a public issue tracker.
If you tell us there's a security issue, we take it as real until it's
shown not to be. Tools and researchers can find this contact through
security.txt.
What to expect when you report an issue
First, an acknowledgement, from me, that I have received it and that I will review it. I may ask you questions about the issue, and work with you on understanding it better, as well as on a fix, if one is needed. I may also ask you for your proposed timeline for disclosure, and whether you'd agree to a voluntary embargo.
The repository roots
A fingerprint is the SHA-256 of a root file, exactly as the repo serves it. Compare against this page. Don't compare against anything the repo handed you - a repo that's been tampered with will cheerfully tell you its own hash.
| Repo | Root | Fingerprint (sha256) |
|---|---|---|
| Sandcastle Base | version 2, since 2026-10-03 | 5bc141cbfa3b8a9115ebfc4efa81e2e9e8d7bb34894db7b44592b0b6fe532959 |
| Sandcastle Common | version 2, since 2026-10-03 | dc28d9d45e9581837264b33ddf36d8899800c95af796cc3585c287560abeed42 |
| Sandcastle Base | version 3, since 2026-10-12 | 8932a96c368bb5bef9c3ebd8045f88d3bbc29284b0fbea69fb4e1998e2516474 |
| Sandcastle Common | version 3, since 2026-10-12 | 065a1092f2df4c0a6bd8c585d97ba6369856bf02309011bedbfb1c6e7e31a93f |
A system installed before 2026-10-12 is anchored on version 2, and walks forward to version 3 by itself. Up to version 2 one offline root key covered both repos; since version 3 each repo has its own:
| Repo | Root key (keyid) |
|---|---|
| Sandcastle Base | bf94c2341aafa0846752ea0a165bc07f24c5203b8bd02d62507f7fa7cb634935 |
| Sandcastle Common | 6a5eed5448fc9fe1924276996a915332116072295de0710faaefda585fa79571 |
The manifest signing keys
| Repo | Manifest signing key | Signs |
|---|---|---|
| Base | 36558dbbdc9ca7cf7b98b0a25cf96fa97725460cead87ac91b0672c24e5a7c85 |
packages built since 2026-10-03 |
| Common | 6ba4ca26d3aec2e6265ca592764c93c54ac1f34932cac9da257c986d53ab3c91 |
packages built since 2026-10-03 |
The clerks rotate every six months. The keys that signed older packages, and the older roots, are still good for whatever they signed at the time - those are all in the guide.
The image signing key
Signs the image.json of every image on the
download page.
| keyid | Ed25519 public key |
|---|---|
a7febba87f2fc095 |
d9b4efe6e849e6226cec019fd4f69292e62c1a2fe414b82d62e22cfcdc882044 |
When it doesn't match
Stop. Don't add that repo, and don't upgrade from it. Then
tell me, and include the output of
sudo pkg repo list --trust.
How Sandcastle is kept secure
Signed updates
pkg only installs what the repository's keys signed,
using The Update Framework
(TUF). That protects you from fake updates through a man-in-the-middle
attack, a stolen repo server or a DNS takeover, even when you fetch from
a mirror or a cache. It also refuses to roll your system back to an
older, vulnerable version, and the signed timestamp.json
of each repo expires every 4 days, so nobody can freeze you on a stale
copy of a repo for longer than that.
The keys the build host uses are temporary. The clerk keys rotate every six months or so. The only keys that don't expire are the root keys, one per repo. They are never on the build host, or online anywhere: they are kept offline, split across two physical locations, and only come out to rotate the clerks. TUF and signing goes into the details.
Isolated infrastructure
- The repo server is just a web server for the repo data. None of the signing keys are on it.
- This website, with the image checksums, is a different host from the download and repo servers.
- The build host isn't directly on the internet. The code that checks for upstream releases and downloads sources is separated from everything else, and can't touch what gets merged or the repos.
- The repos on the build host are only writable by the builder and the
job that syncs them out. There is no passwordless
sudo, and no token that can accept changes is stored on that machine. - Test runners work in isolation, and the results they send back are treated as untrusted data.
A human reviews every change
There are no automated merges. Coding agents can only propose: the interfaces they have access to can't approve anything, and Governance says it stays that way. Every change goes through content review, which puts the results of each gate in front of the reviewer, down to the per-file changes inside an upstream tarball:
- a license scan, which has to be resolved before a recipe change is accepted;
- a malware scan, for obfuscated or otherwise suspicious code;
- a reproducibility check;
- the package's own tests, where it has any;
- known vulnerabilities.
Sandboxed builds
Building means compiling code we didn't write, so every build runs in a sandbox with no network, and nothing is downloaded during a build. The sandbox stacks seccomp, Landlock, and PID, IPC, mount, user, UTS and network namespaces. It runs on its own tmpfs root with no access outside it, with capabilities cut down and the environment cleared. That way nothing in a build can secretly pull in something that ends up in a signed update.
Reproducible builds
Packages build reproducibly, and a reproducer rebuilds them around the clock. You don't have to take our word for what went into a package: rebuild it yourself and compare.
Hardened defaults
- Old crypto is disabled entirely.
- Daemons don't start by default, ports aren't open by default, and a service shouldn't get pulled in by an accidental dependency.
- Everything is built with
_FORTIFY_SOURCE=3, and PIE, IBT/SHSTK and stack-protector/clash are being rolled out. - Software we don't need isn't packaged. Nothing you don't have can be vulnerable.
Fixes, and your part in them
The build system watches upstream for new releases and stages the update by itself. A fix reaches the repositories as soon as it is reviewed.
Then it's up to you: run sudo
pkg upgrade regularly, and reboot after a kernel update.
pkg check-update
tells you whether there's anything to install, and changes nothing. If an
update breaks something, pkg
rollback takes you back to builds you've already had
installed. There are no automatic updates yet.
Checking it yourself
- Checking a system you already have walks through checking what you have installed against the keys above.
pkg verifychecks the files on disk against their package manifests, and catches anything that changed.pkg provenance verifychecks the signed record of what a package was built from, and that everything it names is still there to rebuild from.pkg provenance rebuildrebuilds it offline and compares the result byte for byte.pkg sbomwrites an SPDX or CycloneDX bill of materials for what you have installed, for your own vulnerability scanner.- Checking an image verifies a download against the image signing key above.
Not there yet
- Vulnerability reports for what you have installed. CVEs are watched by hand for now. A report that shows which of your packages are known to be vulnerable is being worked on.
- Static analysis of the code we ship. Coming.
- An advisory feed. For now, fixes are announced in the posts.