pytorch - 💡(How to fix) Fix [Infra] Missing PEP 700 upload-time metadata breaks supply-chain security tools (uv, pip) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
pytorch/pytorch#179374Fetched 2026-04-08 02:43:28
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
labeled ×5commented ×1cross-referenced ×1

The official PyTorch package index (download.pytorch.org) currently does not expose the upload-time metadata in its package JSON API. While PEP 700 defines this field as technically optional (to support legacy servers), omitting it breaks compatibility with modern package management.

Root Cause

Impact

Because this metadata is missing, modern Python package managers like uv, pip, and pdm cannot verify the age of the PyTorch packages. Features like uv's --exclude-newer are critical for mitigating supply chain attacks (e.g., dependency confusion) by enforcing a "cooldown" period on newly published packages.

RAW_BUFFERClick to expand / collapse

Description

The official PyTorch package index (download.pytorch.org) currently does not expose the upload-time metadata in its package JSON API. While PEP 700 defines this field as technically optional (to support legacy servers), omitting it breaks compatibility with modern package management.

Impact

Because this metadata is missing, modern Python package managers like uv, pip, and pdm cannot verify the age of the PyTorch packages. Features like uv's --exclude-newer are critical for mitigating supply chain attacks (e.g., dependency confusion) by enforcing a "cooldown" period on newly published packages.

Currently, running a secure dependency resolution with a date cutoff fails entirely for PyTorch. I am forced to allow-list torch to bypass these security checks (e.g., using --exclude-newer-package torch). We currently live in the age of supply chain attacks, and many recent attacks across the industry could have been mitigated simply by avoiding running code published at HEAD.

Steps to Reproduce

  1. Create a minimal pyproject.toml depending on torch.
  2. Map the package to the custom index: https://download.pytorch.org/whl/cpu
  3. Run uv lock --exclude-newer "2 weeks"
  4. The resolution fails, outputting warnings for every wheel: warning: torch-<version>.whl is missing an upload date

Expected Behavior

The download.pytorch.org registry infrastructure should be updated to populate the upload-time field for all published wheels as defined in the PEP 700 JSON API. Providing this timestamp will ensure compatibility with modern Python security tooling.

extent analysis

TL;DR

The PyTorch package index should be updated to include the upload-time metadata in its package JSON API to ensure compatibility with modern Python package managers and security tools.

Guidance

  • The missing upload-time metadata in the PyTorch package index is likely the cause of the issue, as it is required by modern package managers like uv, pip, and pdm to verify the age of packages.
  • To verify the issue, create a minimal pyproject.toml depending on torch and run uv lock --exclude-newer "2 weeks" to see if the resolution fails due to missing upload-time metadata.
  • As a temporary workaround, allow-listing torch using --exclude-newer-package torch can bypass the security checks, but this is not a recommended long-term solution.
  • The download.pytorch.org registry infrastructure should be updated to populate the upload-time field for all published wheels as defined in the PEP 700 JSON API.

Example

No code snippet is provided as it is not necessary to illustrate the issue or the solution.

Notes

The solution relies on the PyTorch package index being updated to include the upload-time metadata, which may take time. In the meantime, users may need to use workarounds like allow-listing torch to bypass security checks.

Recommendation

Apply workaround: Allow-listing torch using --exclude-newer-package torch can provide temporary relief, but it is recommended to wait for the PyTorch package index to be updated to include the upload-time metadata for a more secure solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING