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

Unrestricted Access to scoreBoard::setPrediction Function Due to Public Visibility make it accesible to call from anyone

Summary

The setPrediction function is declared as public, allowing any external actor to call it. However, the function should only be callable by the specific player it's intended for, indicating that it should have more restrictive visibility.

Vulnerability Details

The function signature is as follows:

function setPrediction( address player, uint256 matchNumber, Result result ) public {
``// Function body``
}

The public visibility allows any external account or contract to call this function, potentially setting predictions for any player. This is a serious access control issue, as it allows unauthorized manipulation of predictions.

Impact

anyone can call this function directly whitout benn approved or pay the fees

Unauthorized Predictions: Any user can set predictions for any other user, completely bypassing any intended access controls.

Tools Used

Manual Code Review

Recommendations

Change the function visibility to internal:

function setPrediction(
address player,
uint256 matchNumber,
Result result )
internal {
``// Function body``
}

This ensures that only the contract itself or derived contracts can call this function.

Updates

Lead Judging Commences

NightHawK Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

setPrediction lacks access control

setPrediction has no access control and allows manipulation to Players' predictions.

Support

FAQs

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