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

Organiser Bypasses Randomness to Select Ram, Leading to Potential Manipulation and Financial Loss

Summary

The selectRamIfNotSelected function in the Dussehra protocol uses a predictable randomness method, allowing the organiser to manipulate the selection of Ram. This vulnerability can lead to biased outcomes, unauthorized withdrawals, and significant financial losses, undermining the protocol's integrity and fairness.

Vulnerability Details

The selectRamIfNotSelected function allows the organizer to select a Ram using a random selection method. However, the randomness can be bypassed or manipulated by the organiser, leading to the selection of a predetermined user.

The function uses the current block timestamp and block.prevrandao to generate a random number, which can be predicted and manipulated by the organizer to ensure a specific user is selected as Ram.

function selectRamIfNotSelected() public RamIsNotSelected OnlyOrganiser {
if (block.timestamp < 1728691200) {
revert ChoosingRam__TimeToBeLikeRamIsNotFinish();
}
if (block.timestamp > 1728777600) {
revert ChoosingRam__EventIsFinished();
}
uint256 random = uint256(keccak256(abi.encodePacked(block.timestamp, block.prevrandao))) % ramNFT.tokenCounter();
selectedRam = ramNFT.getCharacteristics(random).ram;
isRamSelected = true;
}

Impact

Manipulation by Organiser: The organiser can control the selection process, leading to unfair and biased outcomes.

Financial Loss: If the organiser selects a specific user as Ram, they can collude to withdraw funds unfairly, leading to significant financial losses for other participants.

Tools Used

Manual review

Recommendations

Use Secure Randomness: Implement a more secure randomness method, such as Chainlink VRF, to ensure the selection process is fair and tamper-proof.

Updates

Lead Judging Commences

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

Weak randomness in `ChoosingRam::selectRamIfNotSelected`

The organizer is trusted, but the function `ChoosingRam::selectRamIfNotSelected` uses a way to generate a random number that is not completely random.

Support

FAQs

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