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-76] Session key data storage collision #14

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

adam-alchemy
Copy link
Contributor

Motivation

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

Session key data incorrectly truncates the last 4 bytes of the storage key, leading to collisions for the first 2 ^ 32 - 1 storage keys.

Solution

Remove the unnecessary packing and truncating logic from _sessionKeyDataOf.

Add a test asserting key data is distinct across session keys.

Fix a a comment incorrectly stating the order of element packing for contract data.

Remove an old comment referencing a removed file PermissionsCheckerPlugin.

@adam-alchemy adam-alchemy merged commit 7e58e99 into audit-2023-11-20 Dec 12, 2023
3 checks passed
@adam-alchemy adam-alchemy deleted the adam/fix-76 branch December 12, 2023 20:45
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