Skip to content

fix(update): verify self-update and install.sh against immutable, attested release artifacts #230

Closed

Description

@abruption

What happened

Security and stability hardening audit finding H03 / P2 (2026-09-28). Priority is an audit recommendation, not a claim of a production incident.

The PyPI path is well gated since #117: the tag must be the event commit on protected main, builds are reproduced, and wheel/sdist are covered by SHA256SUMS, build provenance and PEP 740 attestations. The two standalone install paths bypass those gates:

  • session-peer update (standalone installs) takes the latest release tag and downloads raw.githubusercontent.com/abruption/session-peer/{tag}/session_peer.py. It reads the response without a size limit and accepts it if it contains the bytes __version__. There is no digest, no check that the file's version equals the tag, and no compile or --version check before replacing itself.
  • install.sh downloads from main, i.e. unreleased code, not the latest release.

Nothing on GitHub makes the tag or release immutable: gh api repos/abruption/session-peer/rulesets returns [], v1.0.0 to v1.0.2 report immutable: false, and releases carry no assets. "Never move an existing published tag" in RELEASING.md is policy only. A moved tag, or a release published outside the workflow, would be served to self-updating clients even though the PyPI publish would fail closed.

What you expected

  • A tag ruleset blocking update and deletion of v* tags, and GitHub Immutable Releases enabled.
  • The standalone session_peer.py published as a release asset, included in SHA256SUMS and the provenance attestation.
  • Self-update downloads that asset, enforces a size cap, verifies the digest, the literal __version__ against the tag, and --version of the staged file before replacement.
  • install.sh installs the latest release by default (explicit main opt-in only) and applies the same verification.

Environment

  • Baseline: published session-peer v1.0.2, commit 2046836822b88e53246de73851186598604cb5ec.
  • Reproduction: source review plus read-only GitHub API queries (rulesets, releases); nothing was published or modified.
  • Audit environment: macOS arm64, Python 3.14.7.
  • No live message tests or production mutation.

Source evidence

Acceptance criteria

  • Tag ruleset and Immutable Releases are enabled and recorded in RELEASING.md.
  • The release workflow publishes the standalone asset with digest and attestation, and fails if it differs from the tagged source.
  • Self-update rejects oversized, digest-mismatched, wrong-version and non-running files, leaving the current file untouched.
  • install.sh defaults to the verified latest release; tests cover mismatch and success.

Scope and limitations

Target: v1.0.3 hardening work. This issue does not authorize a release or operating-service changes; repository setting changes need owner approval.

Related, not duplicates: #117 (PyPI release gates), #204 (staged install.sh writes), #185 (Homebrew distribution).

Checked

  • Searched existing issues for duplicates.
  • Removed credentials, conversation contents, private paths and real device/session identifiers.
  • Used isolated fixtures without weakening inbound permissions.

Activity

  1. added this to the v1.0.3 milestone on Sep 28, 2026
  2. added
    bug
    on Sep 28, 2026
  3. abruption commented on Oct 5, 2026

    @abruption
    OwnerAuthor

    v1.0.3 is now an immutable stable release with seven assets. Preparation/main/publication gates passed; all seven exact-source attestations verified locally. The actual public-release download/provenance/manifest verifier passed against v1.0.3 and commit 0d25255, including staged standalone version validation. Published PyPI wheel/sdist hashes match the locked candidates. This is live signed-asset acceptance evidence, not a fleet deployment or an update of existing installed runtimes. Release: https://github.com/abruption/session-peer/releases/tag/v1.0.3

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions