AccountFacetImpl.sol:withdraw allows draining of funds
Summary
The withdraw function deducts an 18-decimal scaled amount from the user's balance but transfers the original, unscaled amount of tokens, potentially allowing users to withdraw more funds than they actually possess, which could lead to draining the contract's funds
Root Cause
The oversight in the withdraw function as it subtracts amountWith18Decimals from the user's balance but transfers the unscaled amount to the user as shown below allows draining of the protocol since users can specify any amount
air_0x
High
AccountFacetImpl.sol:withdraw allows draining of funds
Summary
The withdraw function deducts an 18-decimal scaled amount from the user's balance but transfers the original, unscaled amount of tokens, potentially allowing users to withdraw more funds than they actually possess, which could lead to draining the contract's funds
Root Cause
The oversight in the withdraw function as it subtracts
amountWith18Decimals
from the user's balance but transfers the unscaledamount
to the user as shown below allows draining of the protocol since users can specify anyamount
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
draining of protocol
PoC
No response
Mitigation