Flow

Sablier
FoundryDeFi
20,000 USDC
View results
Submission Details
Severity: medium
Invalid

Lack of Access Control in Batch Function

Summary

The absence of access control in the batch function allows unauthorized execution of arbitrary functions, posing significant security risks, including unauthorized state manipulation and potential denial of service. Implementing access control measures, such as an onlyOwner modifier or other relevant access control patterns, is crucial to mitigate these risks and ensure the integrity and functionality of the contract.

Vulnerability Details

The batch function in the contract lacks any form of access control, allowing any external user to call it. This function utilizes delegatecall to execute arbitrary functions within the contract's context. Without appropriate access restrictions, unauthorized users can manipulate contract behavior, leading to various security vulnerabilities.

Impact

Unauthorized users can execute any function within the contract, resulting in unintended state changes or exploitation of vulnerable functions. This could lead to unauthorized transfers, modifications, or deletions of critical data.

Tools Used

Manual Review

Recommendations

To address the lack of access control in the `batch` function, apply onlyOwner modifier so that only owner can access it.

import "@openzeppelin/contracts/access/Ownable.sol";
abstract contract Batch is Ownable {
function batch(bytes[] calldata calls) external onlyOwner {
uint256 count = calls.length;
for (uint256 i = 0; i < count; ++i) {
(bool success, bytes memory result) = address(this).delegatecall(calls[i]);
if (!success) {
revert Errors.BatchError(result);
}
}
}
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Design choice
inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Appeal created

ghufranhassan1 Submitter
9 months ago
inallhonesty Lead Judge
9 months ago
inallhonesty Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

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