-
Notifications
You must be signed in to change notification settings - Fork 445
[SECURITY DISCLOSURE] Critical Vulnerability found in abaci.sol #297
Copy link
Copy link
Open
Description
Bug Report: Critical and High Severity Bugs
Contract Name: LinearDecrease and StairstepExponentialDecrease
Severity: Critical
Bug 1: Unprotected Function
- Location:
filefunction in both contracts - Description: The
filefunction allows an authorized user to modify thetauvariable in the LinearDecrease contract andstepandcutvariables in the StairstepExponentialDecrease contract. However, there is no input validation to prevent an authorized user from setting these variables to arbitrary values, which could potentially disrupt the intended functionality of the contracts. - Recommendation: Implement input validation to restrict the range of acceptable values for
tau,step, andcut.
Bug 2: Reentrancy Vulnerability
- Location:
relyanddenyfunctions in both contracts - Description: The
relyanddenyfunctions emit events, which can lead to reentrancy vulnerabilities if the contract that receives these events is not properly secured. - Recommendation: Consider using a reentrancy guard or implementing a secure event emission mechanism.
Bug 3: Division by Zero
- Location:
pricefunction in the LinearDecrease contract - Description: The
pricefunction divides bytau, which could be zero if an authorized user sets it to zero using thefilefunction. This would result in a division by zero error. - Recommendation: Add a check to ensure that
tauis non-zero before performing the division.
Bug 4: Lack of Input Validation
- Location:
pricefunction in both contracts - Description: The
pricefunctions do not validate their inputs, which could lead to unexpected behavior or errors if invalid inputs are provided. - Recommendation: Implement input validation to ensure that the inputs to the
pricefunctions are valid and within the expected ranges.
Additional Recommendations:
- Consider adding a
pausefunction to allow authorized users to pause the contract in case of an emergency. - Implement a secure way to handle errors and exceptions, such as using a try-catch block or a custom error handling mechanism.
- Review the contracts for any potential gas-related issues and optimize the code to minimize gas consumption.
Conclusion:
The LinearDecrease and StairstepExponentialDecrease contracts have several critical and high-severity bugs that need to be addressed to ensure their security and functionality. It is recommended to implement the suggested fixes and recommendations to mitigate these bugs.
RECOMMENDATION: Immediate patch required. Bug Bounty Payout Address (ERC20): 0xe744f6791a685b0A0cC316ED44375B69361c837F
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels