Skip to content

Security: pirc-dev/pirc

SECURITY.md

Security

Report a security problem privately, by email to security@pirc.dev, not in an issue. Say what is affected (the relay, the extension, the web app, the apps or the push gateway), the version, and how to reproduce it if you can.

Fixes go into the latest release only, so check that the problem is still there in it. Each release's notes say what it fixes.

What PiRC trusts

These are by design, not vulnerabilities; docs/design.md (sections 5.1 and 6) has the reasons.

  • A client is a shell on every host. A phone, a browser or the web app's server, once joined to your relay, can prompt pi on every host the relay admits, and pi runs its tools with the permissions of whoever started it. That is what PiRC is for. Where pi runs is your choice: in a sandbox, in a virtual machine, or under your own account, accepting the risk. A lost phone is removed with pirc-relay remove, or from another client, and the relay disconnects it within a second.
  • Whoever runs your relay can read everything. Messages are not end-to-end encrypted: TLS, WireGuard or Tailscale protect them in transit; the relay's code never reads or logs them, but whoever runs it could. On a rented server, so could whoever runs the server. The web app's server reads every message, to draw the page, so run it where you run the relay. Join someone else's relay only if you would let them read your sessions. End-to-end encryption between client and host arrives with the hosted relay.
  • PiRC's push gateway, push.pirc.dev, learns which relay's address woke which phone, and when, and nothing about a session: the relay sends it only an opaque handle, and the notification it sends carries fixed text. A relay works without it, but its phones are then not woken.

Checking a release

From 0.3.7, each release's tag, vX.Y.Z, is signed with ssh by a key listed in allowed_signers. In a clone:

git -c gpg.ssh.allowedSignersFile=allowed_signers verify-tag vX.Y.Z

prints Good "git" signature for igor@soarez.org. The file comes from the same repository as the tag, so it proves only that a key it lists made the tag; GitHub marking the tag Verified, against the keys on the publisher's account, is a second source. A release's downloads are built from its tag: check them with its SHA256SUMS (shasum -a 256 -c SHA256SUMS). The extension's own repository, pirc-extension, does not sign its tags: to install a checked extension, install it from the release's pirc-extension-X.Y.Z.tar.gz once it matches (the guide's "The extension" says how).

From 0.3.8 the extension is on npm, as pirc-extension, published from that same archive, byte for byte, so npm's integrity for a version is the archive's own. With an archive that matches SHA256SUMS, these print the same line:

npm view pirc-extension@X.Y.Z dist.integrity
echo "sha512-$(openssl dgst -sha512 -binary pirc-extension-X.Y.Z.tar.gz | base64)"

Every version after 0.3.8 is published by a GitHub Action in this repository (.github/workflows/npm.yml) and carries npm's provenance, which npm audit signatures checks.

The store apps

No one, the publisher included, can show that an app from the App Store or Google Play was built from this repository. Apple encrypts every App Store binary for the device it is installed on, so it cannot be compared with a build from source; Google Play re-signs and splits the app it serves. This is so for every app in those stores, Signal's included. What narrows it: the apps' source is here, under the GPL, and anyone can build and install their own (app/README.md); with the hosted relay, a device is trusted only once a device already on the account has signed it onto the account's list (docs/e2e.md), so a changed app on someone else's phone cannot add itself to your account. A changed app on your own phone could read and act on everything, as any app you install could.

The web app at app.pirc.dev can be checked, unlike them: it is static files, built reproducibly from the signed tag /version.txt names, and it serves /SHA256SUMS, the SHA-256 of every file it serves. In that tag's build (sh/build.sh web-hosted <dir>), shasum -a 256 --ignore-missing -c SHA256SUMS should pass for every file; hosted.json, the relay a new browser joins, is the site's own and not in the build. pirc.dev/check/ goes through it step by step.

There aren't any published security advisories