HardhatDeFi
15,000 USDC
View results
Submission Details
Severity: high
Invalid

Improper Access Control found in `AaveDIVAWrapperCore::_registerCollateralToken`, `AaveDIVAWrapperCore::_createContingentPool` and `AaveDIVAWrapperCore::_addLiquidity `

Description: Improper access control occurs when a contract function is accessible to unauthorized users, potentially allowing them to perform actions that should be restricted. In the AaveDIVAWrapperCore contract, functions such as _registerCollateralToken, _createContingentPool, and _addLiquidity are internal. These functions are intended to be called by derived contracts. However, if derived contracts expose these functions without implementing proper access control, unauthorized users could exploit them.

Impact:

  • Unauthorized users could register collateral tokens, create pools, add liquidity, or manipulate the contract in unintended ways.

  • This could lead to financial loss, disruption of contract functionality, or exploitation of the protocol.

Proof of Concept: Consider a derived contract that exposes the _registerCollateralToken function without access control:

contract DerivedWrapper is AaveDIVAWrapperCore {
function registerCollateralToken(address _collateralToken) external {
_registerCollateralToken(_collateralToken);
}
}

In this example, any user can call registerCollateralToken and register arbitrary tokens, potentially disrupting the contract's intended operation.

Recommended Mitigation:

  • Use Access Control Modifiers: Implement access control modifiers such as onlyOwner or onlyAuthorized to restrict access to sensitive functions.

Example:

function registerCollateralToken(address _collateralToken) external onlyOwner {
_registerCollateralToken(_collateralToken);
}

By ensuring that only authorized users can access critical functions, you can mitigate the risk

Updates

Lead Judging Commences

bube Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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