Repository navigation
Description
What happened
Security and stability hardening audit finding H08 / P3 (2026-09-28). Priority is an audit recommendation, not a claim of a production incident.
The publish job runs in the GitHub environment pypi, which PyPI Trusted Publishing is bound to. That environment has no protection:
gh api repos/abruption/session-peer/environments
name: pypi
protection_rules: []
deployment_branch_policy: null
can_admins_bypass: true
RELEASING.md requires final user approval immediately before publication, but nothing enforces it. Publishing a GitHub release (including by mistake, or from any tag the workflow accepts) starts the upload automatically, and PyPI files cannot be replaced or reused once uploaded. The workflow's own source checks fail closed on tag/version/ancestry mismatches, but they are not a human approval gate.
What you expected
- A required reviewer on the
pypienvironment (the maintainer; self-review allowed for a single-maintainer repository), so the publish job waits for explicit approval after build, install and audit jobs have passed. - Deployments to
pypirestricted to tags matchingv*. - Administrator bypass disabled if practical, or its use documented.
- The PyPI Trusted Publisher confirmed to require environment
pypi, so the upload cannot be made from a job outside this environment.
Environment
- Baseline: published session-peer v1.0.2, commit
2046836822b88e53246de73851186598604cb5ec. - Reproduction: read-only GitHub REST API query and source review; no settings were changed and no workflow was run.
- Audit environment: macOS arm64.
- No live message tests or production mutation.
Source evidence
- .github/workflows/publish.yml#L167-L174 —
publishjob usesenvironment: pypiwithid-token: write - .github/workflows/publish.yml#L1-L5 — triggered by
release: published - RELEASING.md#L40-L45 — Trusted Publisher mapping
- RELEASING.md#L84-L93 — approval step that is currently procedural only
Acceptance criteria
-
pypienvironment has a required reviewer and av*tag deployment policy, confirmed through the API. - PyPI Trusted Publisher configuration verified to name environment
pypi. - RELEASING.md describes the approval step as the environment review and how to reject a pending deployment.
- The next release confirms the job pauses for approval before upload.
Scope and limitations
Target: v1.0.3 hardening work. This issue does not authorize a release or operating-service changes; environment and PyPI settings are owner actions.
Related, not duplicates: #117 (release gates and publication provenance).
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
abruption commentedon Sep 28, 2026
Repository settings applied (2026-09-28), confirmed through the API:
pypienvironment:required_reviewers(maintainer, self-review allowed) and a custom deployment policy limited to tags matchingv*.Remaining acceptance items:
pypi(not visible through the GitHub API).abruption commentedon Sep 29, 2026
PyPI Trusted Publisher verified on 2026-09-29: the GitHub publisher for this project is bound to repository
abruption/session-peer, workflowpublish.ymland environmentpypi. Combined with the environment's required reviewer andv*tag policy, a PyPI upload now requires an approved deployment from that environment.Remaining:
abruption commentedon Oct 5, 2026
v1.0.3 acceptance evidence: exact main 0d25255; preparation run https://github.com/abruption/session-peer/actions/runs/37247147805 and publication/verification run https://github.com/abruption/session-peer/actions/runs/37247453910 succeeded. The PyPI job was observed waiting on environment pypi before upload, followed by review history state approved, user abruption, environment pypi. No administrator bypass or automated approval was used. Candidate hashes/provenance were reviewed before publication; upload and fresh-install/hash verification passed. Rejection UI remains documented rather than exercised on this successful publication.