Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document PyPI's protections against resurrection attacks #13720

Merged
merged 3 commits into from May 22, 2023

Conversation

tnytown
Copy link
Contributor

@tnytown tnytown commented May 22, 2023

See #13469.

Signed-off-by: Andrew Pan <a@tny.town>
@tnytown tnytown requested a review from a team as a code owner May 22, 2023 18:24
Comment on lines 193 to 200
To solve this issue, PyPI worked with GitHub to add the `repository_owner_id`
claim to OIDC tokens. This claim attests to the ID of the repository owner,
which is stable and permanent unlike usernames. When a trusted publisher is
configured, PyPI looks up the configured username's ID and stores it. During
API token minting, PyPI checks the `repository_owner_id` claim against the
stored ID and fails if they don't match. Through this process, only the original
GitHub user remains authorized to publish to their PyPI projects, even if they
change their username or delete their account.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably don't need the specific history here 🙂 -- we can just say "for GitHub-based publishers, PyPI always checks the repository_owner_id claim, since ..."

@woodruffw
Copy link
Member

A few small nits, otherwise LGTM!

Signed-off-by: Andrew Pan <a@tny.town>
Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@di di merged commit b7bf32e into pypi:main May 22, 2023
17 checks passed
@woodruffw woodruffw deleted the ap/issue/13469 branch May 22, 2023 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants