Rebasing tokens are tokens that have each holder's balanceOf increase over time: this includes for example AMPL and AAVE tokens.
If any of these tokens are used and deposited into escrow, their yield matured will be permanently locked, as they will be accrued to DelegateToken instead of the original owner.
Proof of Concept
Bob calls DelegateToken.create with DelegationType.ERC20, and he deposits his AAVE tokens
The erc20UnderlyingAmount is the same as it was when the tokens were originally deposited, but they have matured some yield over time. As such, this yield will be permanently locked inside DelegateToken, as there is no way to withdraw it.
Tools Used
Manual review
Recommended Mitigation Steps
Ideally, the owner should be able to withdraw the interest matured over time when they call the withdraw function.
Alternatively, consider fully documenting the code and the official docs, stating that rebasing tokens should NOT be used, as they are not supported.
Lines of code
https://github.com/code-423n4/2023-09-delegate/blob/main/src/DelegateToken.sol#L310-L315 https://github.com/code-423n4/2023-09-delegate/blob/main/src/DelegateToken.sol#L370-L375
Vulnerability details
Impact
Rebasing tokens are tokens that have each holder's
balanceOf
increase over time: this includes for example AMPL and AAVE tokens.If any of these tokens are used and deposited into escrow, their yield matured will be permanently locked, as they will be accrued to
DelegateToken
instead of the original owner.Proof of Concept
Bob calls
DelegateToken.create
withDelegationType.ERC20
, and he deposits his AAVE tokenshttps://github.com/code-423n4/2023-09-delegate/blob/main/src/DelegateToken.sol#L310-L315
Some time passes, and Bob decides to burn his principal and
withdraw
these tokens:https://github.com/code-423n4/2023-09-delegate/blob/main/src/DelegateToken.sol#L370-L375
erc20UnderlyingAmount
is the same as it was when the tokens were originally deposited, but they have matured some yield over time. As such, this yield will be permanently locked insideDelegateToken
, as there is no way to withdraw it.Tools Used
Manual review
Recommended Mitigation Steps
Ideally, the owner should be able to withdraw the interest matured over time when they call the
withdraw
function.Alternatively, consider fully documenting the code and the official docs, stating that rebasing tokens should NOT be used, as they are not supported.
Assessed type
ERC20