The lack of a direct exchange access check in the depositCollateralAndIncreaseShare function may allow unauthorized wallets to execute the function, potentially leading to unintended or insecure operations. This could compromise the security and functionality of the overall system.
Proof of Concept
The depositCollateralAndIncreaseShare function allows users to deposit WBTC/WETH liquidity as collateral and increase their collateral share. Although it includes the ensureNotExpired modifier, ensuring the transaction is not expired, it lacks a direct check for exchange access. The absence of an explicit check for exchange access might pose a security risk if the function is intended to be executed only by wallets with exchange access.
It is recommended to include a check for exchange access within the depositCollateralAndIncreaseShare function. This can be achieved by adding an access control modifier or by integrating a mechanism to verify the calling wallet's permissions before allowing the execution of the function.
Lines of code
https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L70-L76
Vulnerability details
Impact
The lack of a direct exchange access check in the
depositCollateralAndIncreaseShare
function may allow unauthorized wallets to execute the function, potentially leading to unintended or insecure operations. This could compromise the security and functionality of the overall system.Proof of Concept
The
depositCollateralAndIncreaseShare
function allows users to depositWBTC/WETH
liquidity as collateral and increase their collateral share. Although it includes theensureNotExpired
modifier, ensuring the transaction is not expired, it lacks a direct check for exchange access. The absence of an explicit check for exchange access might pose a security risk if the function is intended to be executed only by wallets with exchange access.Tools Used
Manual
Recommended Mitigation Steps
It is recommended to include a check for exchange access within the
depositCollateralAndIncreaseShare
function. This can be achieved by adding an access control modifier or by integrating a mechanism to verify the calling wallet's permissions before allowing the execution of the function.Assessed type
Access Control