Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Valid

Horses can't be fed at all times

Summary

Horses can't be fed at all times

Vulnerability Details

Huff version of HorseStore.feedHorse prevents users from feeding their horses if block.timestamp % 17 == 0. Transaction will revert if this happens. Users will be DOS very often, basically every 17 seconds.

PoC

function testHorseCantBeFedAtCertainTimes() public{
vm.prank(alice);
horseStore.mintHorse();
skip(16);
vm.expectRevert();
horseStore.feedHorse(0);
skip(1);
horseStore.feedHorse(0);
}

Impact

HIGH. Impacts all users. Breaks second invariant: Horses must be able to be fed at all times.

Tools Used

Manual review, Foundry.

Recommendations

Remove the condition that prevents feeding horses when timestamp % 17 == 0. There should be no check on timestamp.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

FEED_HORSE() macro does not allow users to feed a horse if the timestamp is divisible by 17

Support

FAQs

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