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

Non existent horses can be fed.

Summary

feedHorse don't check whether provided horseId exists or not.

Vulnerability Details

Any random horseId can be fed.

function testFeedingNonExistentHorse() public {
uint256 horseId = horseStore.totalSupply();
vm.prank(user);
horseStore.feedHorse(horseId+5); // random horse number
assertEq(horseStore.horseIdToFedTimeStamp(horseId+5), block.timestamp);
}

Impact

Medium

Tools Used

foundry

Recommendations

require(horseId <= totalSupply());
Updates

Lead Judging Commences

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

Nonexistent horses can be fed

Support

FAQs

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