-
Notifications
You must be signed in to change notification settings - Fork 600
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
Can't remove deleted organizations from crate owners #1818
Comments
Any progress here? |
If there was progress, it would be posted to the issue. |
Over on #7042, @nic-hartley said:
All of the github related code is in https://github.com/rust-lang/crates.io/blob/main/src/github.rs; hopefully that's a useful starting place? I can provide more pointers later if needed. The problem is that the current code is asking GitHub for existence of the org/team before removing it from the crate's owners, and the code should not need to check anything with GitHub in this case; it should just change the record in |
@carols10cents I appreciate the pointer! A quick fix does seem entirely doable to me (another variant or parameter for But as pointed out in the original post I do think this is a security issue, if only a minor one, so it might be better to build in some "does it still exist" check for crate owners, and delete GitHub organizations when they stop existing. Not sure how to build that, though, especially considering edge cases (what if the last owner of a crate gets deleted?) I'll start a pull request (hopefully tonight! But I've got some boxes to carry.) with the quick fix, hopefully folks more experienced with the codebase have ideas for the autoremove. I don't think this issue occurs with normal users but I'll test it and make sure. |
We don't currently poll GitHub for deletions of orgs/teams/users at all, and I don't think we need to add that. There are GitHub organization IDs and team IDs that change if ownership of the GitHub organization changes. Also, people who own a crate only via a team can't modify owners (they can only publish/yank). And we have a check that won't let you remove the last owner of a crate. So here's what crates.io sees:
Am I missing some case you're thinking of that would be a security problem? |
Ah, okay, I didn't realize we were tracking org ID rather than org name, my bad. Org name is all that gets presented in the UI and I only just started looking into the codebase. As long as there's no way to "reacquire" an old org ID, then we're good. Current plan is to basically add a boolean parameter that's actually used in |
I'm running into a similar issue, where the org/team I'm trying to delete still exists, but the GitHub org has since enabled the IP allow-listing GitHub feature, so crates.io is no longer able to verify if the org/team exists. Attempts to delete, result in:
I'm presuming the switch to looking up from the DB (and not making requests to GitHub) in #7051 will presumably fix our case too? |
@edmorley I'm reasonably sure you're correct that this will fix your case, yes. With 7051 we wouldn't hit the API at all for owner removal, so whatever the API would say is irrelevant. |
Title. Also see similar? issue #1512, which the author closed.
The error is
A workaround exists, which is to recreate the organization and team, which lets you delete it.
But that may also be a potential security issue, what if someone else creates it and maliciously abuses their newly granted publish privileges? What about for organization renames?
The text was updated successfully, but these errors were encountered: