CI Blocker Proposal: Enforce PyPI Name Reservation to Prevent Hijacking Attacks
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 130
Description
**Context:**
We have seen an increasing number of attacks on PyPI where malicious actors monitor open PRs for unreleased Python packages, then immediately register the package name to demand a security bounty. Since PyPI does not support pre-reservation of names, this has become a recurring source of noise and security alerting. Our current mitigation is to run a pipeline ([reservation pipeline link](https://dev.azure.com/azure-sdk/internal/_build?definitionId=8013)) whose sole job is to reserve a name on PyPI by uploading an empty package.
**Proposal:**
- Add a CI blocker step to the SDK Validation check in spec PRs
- For each relevant spec PR, extract the package name destined for PyPI.
- Validate whether the package name is already registered on PyPI.
- If the name does **not** exist, block the PR and write a message in the logs instructing the developer to trigger the reservation pipeline.
- If the name **does** exist, allow the PR to proceed.
**Rationale:**
It is extremely difficult for malicious actors to infer the actual published PyPI name solely from a spec PR and corresponding `tspconfig` file. Therefore, this process will effectively close the loophole while minimizing effort for package authors.
**Related:**
- [Current Reservation Pipeline](https://dev.azure.com/azure-sdk/internal/_build?definitionId=8013)
CC: @lmazuel @weshaggard
Contributor guide
Assessment
This issue has not been assessed yet.