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

fix: [spearbit-34] Session key rotation registration check #19

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

adam-alchemy
Copy link
Contributor

Motivation

https://github.com/spearbit-audits/alchemy-nov-review/issues/34

Session key permissions rotation does not check that the key is registered prior to rotation. This allows key rotation to override existing permissions, and to do pointless key rotations into the same key.

Solution

Add a check asserting that the new key to rotate into is not already registered.

Add a test asserting a revert in the case where the key to rotate into is the same or already registered.

Copy link
Collaborator

@fangting-alchemy fangting-alchemy left a comment

Choose a reason for hiding this comment

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

Looks good. One nit for consistency.

@adam-alchemy adam-alchemy merged commit bfb9b65 into audit-2023-11-20 Dec 13, 2023
3 checks passed
@adam-alchemy adam-alchemy deleted the adam/fix-34 branch December 13, 2023 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants