Skip to content

gpg --verify on signed .deb packages does not verify package contents #17683

Open

Description

@kevinushey

Intent

Follow-up to #14115 (comment: #14115 (comment)).

Problem

We currently sign .deb releases with dpkg-sig (docker/jenkins/sign-release.sh), which embeds a signed manifest of member hashes into the archive as the _gpgbuilder ar member.

The verification instructions on https://posit.co/code-signing/ suggest:

gpg --verify rstudio-download-1.2.3.deb

This is misleading. gpg --verify finds the embedded ASCII-armored signed text and verifies the signature over the manifest itself, but it does not recompute the hashes of debian-binary, control.tar.*, or data.tar.* and compare them against the manifest. A .deb whose payload was modified after signing can still produce "Good signature" from gpg --verify, as long as the embedded manifest text is left intact.

dpkg-sig --verify did both halves (signature check + hash check against the manifest), but dpkg-sig is no longer packaged in Debian 12 / Ubuntu >= 23.10, which is what motivated #14115 in the first place. The page update that closed #14115 swapped in gpg --verify, but that command does not provide the same guarantee.

Possible resolutions

  • Switch signing to debsigs so users can verify with debsig-verify (which does check member hashes).
  • Additionally publish a CHECKSUMS256 (or per-file .sig) alongside each .deb, signed with the same release key, so users can verify payload integrity with plain gpg --verify + sha256sum -c.
  • At minimum, update https://posit.co/code-signing/ to stop implying that gpg --verify <deb> validates the installable payload.

Reproduce

  1. Take any signed .deb from the official downloads.
  2. Modify a byte inside data.tar.zst (e.g. flip a bit with a hex editor), keeping the ar member sizes the same.
  3. Run gpg --verify rstudio-*.deb. The signature still verifies.
  4. dpkg-deb -c against the same file shows the tampered contents would have been installed.

Activity

  1. added
    new
    on May 19, 2026
  2. kevinushey commented on May 19, 2026

    @kevinushey
    CollaboratorAuthor

    How other vendors handle this

    Quick scan of how popular cross-platform apps sign and let users verify their .deb downloads, for context on which direction to take:

    APT-repo signing only (dominant pattern). Chrome, Docker, VS Code, Brave, Firefox, Signal, GitHub CLI, 1Password, Slack all use signed Release/InRelease as the primary verification path -- keyring at /usr/share/keyrings/, referenced via signed-by= in sources.list. APT verifies on install; no per-.deb step is documented. This matches Debian's own recommendation; per-package signatures from developers are explicitly stripped on archive entry.

    Per-package signing via debsigs + debsig-verify (the modern replacement for dpkg-sig). Slack and 1Password both ship complete debsig-verify policy/keyring instructions. This is the closest semantic replacement for what we do today, and it's what Debian's own docs point at for the per-package case.

    dpkg-sig + dpkg-sig --verify. Effectively just Zoom and us at this point. dpkg-sig is no longer packaged in Debian 12 / Ubuntu >= 23.10. Zoom is retiring keys in Feb 2026 but hasn't announced a replacement scheme.

    Detached .sig/.asc files alongside the .deb are uncommon. Where they appear (Brave, 1Password) they cover install scripts or tarballs, not the .deb itself. Checksum files (Docker Desktop, GitHub Releases) show up as a convenience, not a primary verification path.

    Implications

    We distribute via both a Posit-hosted repo and direct download, so:

    • APT-repo signing alone covers repo users but does nothing for the direct-download flow that posit.co/code-signing actually targets.
    • debsigs + debsig-verify is the cleanest fix: it closes the verification gap, matches what other vendors with a direct-download .deb (Slack, 1Password) do, and the doc page can keep its "verify before you install" shape with just a swap of tool.
    • Detached .asc is the easy fallback if debsigs adoption is too heavy -- not common practice, but trivially scriptable and works with plain gpg --verify.

    References:

  3. added theissue type on May 19, 2026
  4. added this to the Blue Plumbago milestone on May 20, 2026
  5. cm421 commented on May 20, 2026

    @cm421
    Contributor

    We should do this for all of our products at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugnew

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions