Unchecked return of execute()
In one place in VaultController.sol, the return value of an external call through AdminProxy.execute() is not checked, unlike other calls. If that call fails, the contract continues silently, so the adapter's performance fee may not be set as intended.
Submitted by 0xNazgul, also found by Deivitto
Across the VaultController.sol there are many external calls to the AdminProxy.sol via execute(). Looking at the execute() function in AdminProxy.sol:
function execute(address target, bytes calldata callData)
external
onlyOwner
returns (bool success, bytes memory returndata)
{
return target.call(callData);
}
As one can see it does a call to the target contract with the provided callData. Going back to the VaultController.sol the success of the call is check and reverts if unsuccessful. However, in one instance this check is missed and could cause issues.
Proof of Concept
Looking at that specific instance:
function __deployAdapter(
DeploymentArgs memory adapterData,
bytes memory baseAdapterData,
IDeploymentController _deploymentController
) internal returns (address adapter) {
(bool success, bytes memory returnData) = adminProxy.execute(
address(_deploymentController),
abi.encodeWithSelector(DEPLOY_SIG, ADAPTER, adapterData.id, _encodeAdapterData(adapterData, baseAdapterData))
);
if (!success) revert UnderlyingError(returnData);
adapter = abi.decode(returnData, (address));
adminProxy.execute(adapter, abi.encodeWithSelector(IAdapter.setPerformanceFee.selector, performanceFee));//@audit unchecked like the others are
}
It is clear that the last call to AdminProxy.sol’s execute is not checked.
Recommended Mitigation Steps
Consider adding a check similar to how it is done in the rest of the contract.
RedVeil (Popcorn) confirmed, but disagreed with severity
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The code calls an external function through a proxy and discards the returned success flag, so a failed call is not detected.
Impact
If the unchecked call fails, the adapter's performance fee is not set, which could lead to incorrect fee behaviour; the report does not show a concrete exploit.
What the attacker needed
Deployment of a vault adapter
The fix
The call's success flag should be checked and the transaction reverted on failure, as is done elsewhere in the contract.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract can call another contract and get back a true/false answer saying whether the call worked. Most of this code checks that answer and stops if it is false, but one call ignores it. That means a failed setup step goes unnoticed, leaving the contract in a state the author did not intend.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.