You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.
sherlock-admin opened this issue
May 5, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
If there is a FootiumClub NFT with id equals to one of the intermediate node of the merkle tree, the owner will be able
to mint players, even if he/she is not in the merkle leaves.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
qpzm
high
FootiumAcademy.mintPlayers
may misinterpret an intermediate node as a leaf.Summary
FootiumAcademy.mintPlayers
may misinterpret an intermediate node as a leaf.Vulnerability Detail
keccak256(abi.encodePacked(clubId, divisionTier))
takes two 32-byte input and returns 32 bytes.This is equal to the process of MerkleProof._hashPair.
If a malicious user use a pair of intermediate nodes as
clubId
anddivisionTier
, the merkle proof verification will pass.https://github.com/sherlock-audit/2023-04-footium/blob/main/footium-eth-shareable/contracts/FootiumAcademy.sol#L239
MerkleProofUpgradeable.verify( divisionProof, _clubDivsMerkleRoot, keccak256(abi.encodePacked(clubId, divisionTier)) )
The vulnerability of 64-byte input is explained in detail in the following issue.
OpenZeppelin/openzeppelin-contracts#3091
Impact
If there is a FootiumClub NFT with id equals to one of the intermediate node of the merkle tree, the owner will be able
to mint players, even if he/she is not in the merkle leaves.
Code Snippet
I changed this test as below and it passed.
https://github.com/sherlock-audit/2023-04-footium/blob/main/footium-eth-shareable/test/FootiumAcademy.test.ts#L247
Tool used
Manual Review
Recommendation
The input length should not be 64 bytes. For example, if
divisionTier
is not that many, we can cast it to smaller bytes.Duplicate of #300
The text was updated successfully, but these errors were encountered: