There is no validation in Aave DIVA Wrapper
and also in Diva Protocol
to check if the passed poolId
belongs to the correct owner.
As a result an attacker who has intention to harm a user can call lets say removeLiquidity
and pass a poolId
which will reduce funds from the passed poolId
.
!!!! Note: As Aave DIVA Wrapper
is integretaded with Diva Protocol
, so we the auditors are not thinking of the validity check on Diva protocol
here, but there should be a validity check on the Aave DIVA Wrapper
, because it is now in the scope of this contest.
The AaveDIVAWrapperCore::_removeLiquidity takes poolId
as parameter then it call IDIVA(_diva).removeLiquidity(_poolId, _positionTokenAmountToRemove);
.
On the LibDIVA::_removeLiquidityLib of Diva Protocol we can see it is reducing fee from the passed poolId
.
So it is calling _reserveFeeClaim
and _allocateFeeClaim
which will reduce amount for fee from the passed poolId -> pool
.
The poolId
owner will lose funds as there is no validation for the poolId
.
Though there are some logic on the contracts that will check msg.sender
's balance and will transfer balances from msg.sender
. But ultimately it reduce lets say fee amount from the passed poolId
.
So the actual owner of the poolId
's balance will be reduced. If a lot of attacker passed his poolId
then his balance will be reduce in huge number.
Manual review
Add validation on functions that poolId
belongs to correct owner which has poolId
as parameter.
Lets say the dataProvider
is the owner of poolId
, so check if the caller (msg.sender) of a function which has poolId
is the actual dataProvider
.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.