Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: medium
Invalid

divergent fallback behavior between horseStore.hff and horseStore.sol

Summary

There is divergent fallback behavior between the huff and solidity version. The huff version does not revert when receiving invalid function signature but the solidity version does.

Vulnerability Details

Add a new test in Base_Test testing contract:

function testFallback() public {
uint256 horseId = horseStore.totalSupply();
vm.prank(user);
(bool success, ) = address(horseStore).call("X");
assertTrue(success);
}

The huff version does not revert, and the solidity version revert.

Impact

Inconsistent behavior between two version. As the solidity version should be the reference code, they should follow the same pattern.

Tools Used

Foundry

Recommendations

Check the fallback pattern and behavior. Consider not implementing the fallback function in Huff version to restrict accessible function signature.

Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.