Skip to content

security: add pre-publication artifact content and startup-hook checks #486

Closed

Description

@codeforester

Goal

Detect package-content injection before any artifact can reach a PyPI publication job.

Current evidence

The artifact validator rejects unexpected top-level wheel members, which should reject the exact root-level cook.pth/ sitecustomize.py payload shape. It does not yet make startup-hook rejection explicit or compare all packaged bytes with the reviewed source manifest.

Scope

  • Reject .pth, sitecustomize.py, and usercustomize.py anywhere they could become startup hooks.
  • Reject duplicate archive members, traversal paths, unexpected executables/native libraries, and unreviewed package data.
  • Compare package file names and hashes against a canonical git archive manifest, with narrowly documented generated-file exceptions.
  • Add malicious fixture archives for cook.pth, sitecustomize.py, an unexpected package, and modified legitimate module content.
  • Keep the check static and pre-install; do not rely on importing the artifact to discover startup code.

Acceptance criteria

  • Every fixture fails closed before the publish job.
  • A legitimate release wheel and sdist continue to pass.
  • The validator's output identifies the offending archive member and does not execute it.
  • The package workflow makes this validation a required gate for both TestPyPI and PyPI.

This is a v1.0 supply-chain security gate.

Activity

  1. added this to the v1.0.0 milestone on Oct 26, 2026
  2. self-assigned this
    on Oct 26, 2026
  3. moved this to Backlog in base-clion Oct 26, 2026
  4. moved this from Backlog to In Progress in base-clion Oct 26, 2026
  5. moved this from In Progress to Ready in base-clion Oct 26, 2026
  6. codeforester commented on Oct 27, 2026

    @codeforester
    ContributorAuthor

    Implementation PR #495 hardens wheel/sdist validation against startup hooks, traversal, duplicates, executable/native members, and source-byte drift.

  7. codeforester commented on Oct 31, 2026

    @codeforester
    ContributorAuthor

    Completed by merged PR #495. Artifact validation now covers the release-content and tamper-resistance checks described by this issue. Closing this issue as completed.

  8. moved this from Ready to Done in base-clion Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

securitySecurity hardening or vulnerability work

Type

No type

Projects

  • Status
    Done

Relationships

None yet

Development

No branches or pull requests

Issue actions