Skip to content

Bug: Release-file sidecar URLs can reference different artifacts #3010

@e-q

Description

@e-q

Describe the bug

Release-file sidecar URL fields are accepted when they point to python.org,
even if they do not correspond to the artifact URL on the same row. For example,
a source tarball entry can expose a GPG signature URL for a different tarball,
and the downloads page/API will present that sidecar as belonging to the listed
artifact.

To Reproduce

  1. In a local python.org development environment, create or submit an
    authenticated release-file API write with:
    • url: https://www.python.org/ftp/python/3.14.0/Python-3.14.0.tgz
    • gpg_signature_file:
      https://www.python.org/ftp/python/3.14.0/Python-3.13.0.tgz.asc
  2. Observe that the row is accepted as long as both URLs use the allowed
    python.org prefix.
  3. Load the release-file API response or release detail page and observe that
    the sidecar is presented for the artifact on that row.

Expected behavior

Sidecar fields should either be blank or match the artifact URL with the
expected sidecar suffix, such as .asc, .sig, .crt, .sigstore, or
.spdx.json.

Additional context

Authenticated v1/v2 release_file POSTs with mismatched sidecar URLs returned
201 before the patch.

A focused regression test can cover both model validation and authenticated v1/v2
release-file API writes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions