Closed code423n4 closed 1 year ago
This is a good find but subscriptionId
is passed into the settings when new Clones are created so it doesn't seem there is any DOS risk.
gzeon-c4 marked the issue as duplicate of #194
gzeon-c4 marked the issue as not a duplicate
gzeon-c4 changed the severity to 3 (High Risk)
gzeon-c4 marked the issue as duplicate of #194
Consider as duplicate of #194 as one of the way the VRF subscription owner can rug.
gzeon-c4 marked the issue as satisfactory
gzeon-c4 changed the severity to 2 (Med Risk)
Lines of code
https://github.com/code-423n4/2022-12-forgeries/blob/main/src/VRFNFTRandomDraw.sol#L80
Vulnerability details
Impact
If a user adds new consumer, function
VRFCoordinatorV2::addConsumer
is called:It reverts if
s_subscriptionConfigs[subId].consumers.length == MAX_CONSUMERS
- MAX_CONSUMERS is hardcoded to 100. Hence, one subscriptionID may have only 100 consumers. User creating a raffle passessubscriptionID
in settings during contract creation, and are unable to change it afterwards. They will only know that they are not whitelisted (because Chainlink's smart contract does not allow to do that) only when trying to start a raffle.Proof of Concept
Please refer to test that ilustrate this issue:
Tools Used
VS Code, foundry
Recommended Mitigation Steps
Allow owner to change subscriptionID by creating specific function.