Files
w3cjandClaude Opus 5.5 f3052e5a8e feat(upgrade): releases checked by two of three release keys, bridged from the old key
devvm upgrade and install.sh accept a release's SHA256SUMS when any two
of three release keys signed it (CI's, the co-signer's and an offline
recovery key's), each in SHA256SUMS.<role>.minisig, checked only against
its own role's key, with the trusted comment devvm-release <version>
compared exactly; one signer counts once. While releases bridge from it,
the old release key's single SHA256SUMS.minisig (devvm <version>) still
passes alone, so 0.1 and 0.2 keep upgrading and --to/--version can
install them; install.sh now checks that key's trusted comment too.

The keys themselves aren't made yet, so packaging/keys holds none and
install.sh's three key lines are empty: a devvm built so checks each
release with the old release key alone, and a release that only the
release keys signed is refused. Releases go out as before, signed with
the old key, until the keys are made and added, all three at once.

- internal/minisign: the one owner of signature checks (moved from
  internal/upgrade): ParsePublicKey, PublicKey.Check (comment always
  compared), Role (CI, Cosign, Recovery), Kind (Release, Base),
  Kind.Comment, SigName, KeyFile, Keys/NewKeys/Keys.Check (two of three,
  distinct keys and key IDs). minisigntest/ signs for tests. Stdlib and
  blake2b only (depguard), a leaf; FuzzCheck, FuzzKeysCheck,
  FuzzParsePublicKey.
- The structure test's signatures rule: outside internal/minisign no
  code calls ed25519/rsa/ecdsa's Verify functions or imports blake2b,
  but signatureFree's files (ubuntu/pgp.go, proxy/nixcache.go).
- internal/upgrade: Source.Keys, checkSums (signatures.go); the bridge
  in legacy.go (checkLegacy, legacyKey, Source.Key); FuzzSumOf.
- packaging/keys/release-{ci,cosign,recovery}.pub, none yet;
  packaging.Key ("" without one). TestReleaseKeys (checkReleaseKeys:
  none, or three distinct minisign keys, none the old key),
  TestCheckReleaseKeys (fixture keys from minisigntest),
  TestInstallScriptKeys (checkInstallScriptKeys: one line per role,
  empty without keys), TestReleaseRefusesPlaceholders (no key in keys/
  marked PLACEHOLDER).
- scripts/release.sh (a tag, --check, --tag; never a snapshot) needs
  none or all three of packaging/keys' release keys. With none,
  install.sh's release_<role>_key lines are empty or missing; with all
  three, each is a minisign key, distinct, not the old release key, not
  marked PLACEHOLDER (placeholder), and equal to its install.sh line.
- install.sh checks with minisign -VHQm: prehashed signatures only.
- The structure guard also flags dot imports of the verifier packages
  and calls of x509's CheckSignature* method names.
- install.sh: release_<role>_key lines, download_signatures (a role's
  signature only when the script has its key), check_signature,
  signed_by_two, check_legacy; plainer warning without minisign, with
  the commands to check by hand.
- Tests: signatures_test.go (TestFetchWithoutReleaseKeys among them),
  upgrade.txtar (-legacy, -keys, and the keys built in, none),
  install.txtar (stub minisign with -Q; NO_KEYS), install_minisign.txtar
  (real minisign), release.txtar (none, nolines, nokeyline, old, marked
  and the rest); DEVVM_RELEASE_KEYS override.
- Docs: internals/install.md, using/upgrading.md, maintaining.md's
  Release keys, structure, tests, testing, SECURITY.md, CHANGELOG,
  releases/0.2.0.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 21:36:37 -07:00

42 lines
3.1 KiB
Markdown

# Security
devvm's job is to keep what runs in a VM away from your machine. The [security model](https://devvm.dev/docs/internals/security/) explains what devvm protects, how it does it, and what it doesn't protect.
## Report a vulnerability
Report a vulnerability privately through [GitHub's vulnerability reporting](https://github.com/devvmhq/devvm/security/advisories/new), not in a public issue. Include the devvm version from `devvm --version`, the host OS, the Lima version and the steps to reproduce it.
## Verifying a release
Each release's `SHA256SUMS` lists the checksums of its archives and of its `install.sh`, and it's signed with minisign. The release key's public half, which is also in `packaging/minisign.pub`, is:
```text
RWSjzFsn7ETaijKJ2y7F4DtZobXmyv+LmdclJwZP/KmAkLUwOCzWF/2b
```
Once devvm has its three release keys, which aren't made yet, devvm upgrade and the install script also accept a `SHA256SUMS` that two of them signed, each in its own `SHA256SUMS.<role>.minisig`, with the trusted comment `devvm-release <version>`. Until then they check the key above alone. The install script checks the signatures when minisign is installed. The script and the keys in it come from the same release, though, so that check can't catch a release that someone replaced whole. Homebrew's checksum can, because it's kept in a separate repository, and so can your own check with the key above, because it doesn't come from the release. [The signature and what it trusts](https://devvm.dev/docs/internals/install/#the-signature-and-what-it-trusts) has the details.
To check a release by hand, run these in the folder with its files:
```sh
minisign -Vm SHA256SUMS -P RWSjzFsn7ETaijKJ2y7F4DtZobXmyv+LmdclJwZP/KmAkLUwOCzWF/2b
shasum -a 256 -c --ignore-missing SHA256SUMS
```
[Checking the install script](https://devvm.dev/docs/internals/install/#checking-the-install-script) shows how to download the script, `SHA256SUMS` and its signature, check them, then run the script.
## What counts
Anything that breaks the security model counts, for example:
- Code in a VM reaching the host, by writing outside its project folder, changing `.git` hooks or config while they're locked, or running code on the host.
- A VM reaching another VM's files, or devvm's state in `~/.local/share/devvm` and `~/.config/devvm`.
- Secrets, logins or SSH keys reaching a VM that should have only a placeholder.
- A VM with network policy reaching a host that isn't allowed, the host's own services, or private addresses.
- Credentials or host files ending up in an image or a shared tool image.
## Out of scope
- What [Attack vectors](https://devvm.dev/docs/safety/attack-vectors/) lists under [Narrowed, not closed](https://devvm.dev/docs/safety/attack-vectors/#narrowed-not-closed) and [Left to you](https://devvm.dev/docs/safety/attack-vectors/#left-to-you), such as what allowed hosts and secrets permit. That includes open VMs, which a VM is when you choose the open tier or pass `--network open`.
- Escapes through Lima, QEMU or Apple's Virtualization framework themselves, which you should report upstream. Do tell us if devvm uses them in an unsafe way.