Open hats-bug-reporter[bot] opened 11 months ago
Yes, the Portal is dependent on the underlying protocol. In the case where the underlying protocol uses proxy contracts, there is always the danger that the Portal gets "rugged" one way or another.
The provided fix does not change anything about the underlying trust assumptions and therefore cannot mitigate a potential Portal insolvency / loss of user funds caused by a malicious change in the HLP proxy.
To my understanding, this is an attack/vulnerability that requires "Access to leaked private keys or trusted addresses" and is therefore out of scope according to the competition rules.
However, I want to personally acknowledge this finding and reward you outside of the competition budget.
I reach out to you on twitter.
Github username: @dontonka Twitter username: 0xDontonka Submission hash (on-chain): 0x16e69d228a69ff099a200fd6f9f38bf32ae518f71e3f4bddce1dd3e365e4d6b4 Severity: high
Description: Description\
_withdrawFromYieldSource
called duringunstake
is interacting with a 3rd party contract which is earning yield. While the currentHLP_STAKING::withdraw
(0xbE8f8AF5953869222eA8D39F1Be9d03766010B1C) seems safe and reverts in case the full requested amount is not withdrawn to the Portal contract, it'san upgradable contract
, so that behavior can always change in the future at any moment. Furthermore, this might not be the case in the future when the Portal use other 3rd party to earn yield.Attack Scenario\ A user just
unstake
as usual amount X but somehow the 3rd app earning the yield does returnless then the requested amount
(X - y), but since no verification is made in Portal (which assume and fully trust the 3rd party yield app, which is the flaw here), all the maths in Portal works, and the user balance is substracted for the full amount X, not the real amount (X - y), and the Portal is sending the real amount to the user.The problem now is that the Portal has incurr a loss for the amount (y), which will make it
insolvent at some point
.Attachments
Proof of Concept (PoC) File
unstake
.Revised Code File (Optional)