-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
SelfOwnedStETHBurner::recoverERC721
may allow moving ERC20s
#443
Comments
Hey-hey, it's a cunning catch, thank you for the report! More to say, the finding was not mentioned by external auditors previously, so you are the genuine discoverer here. I guess that we will stick to the current allowance mechanics for the sake of backward compatibility, though will discuss with the team to consider the second option (i.e. explicit protection) as part of upcoming protocol upgrades. |
Add a test to address the issue #443 regarding missing explicit check on the posibility to recover stETH through the `recoverERC721` func.
The issue is resolved in Lido V2 (#482) |
Decided to re-open because V2 isn't deployed on mainnet yet. |
Hey folks, wanted to point out what could be a minor oversight in the
recoverERC721
function of theSelfOwnedStETHBurner
contract. In principle it does not currently pose a risk for the system. That's why I'm opening an issue just to raise awareness.The function currently looks like:
While it is supposed to allow recovering ERC721 tokens, there's nothing preventing passing an arbitrary address of any contract implementing the
transferFrom(address,address,uint256)
interface. For example, the address of theStETH
contract.However, a griefing attack attempting to take stETH out of the burner contract in this way would fail. Because the
transferFrom
function of theStETH
contract always requires explicit allowances. Even when the caller oftransferFrom
matches the source address of the transfer. That's why there does not seem to be any significant risk right now for the system.Yet there are contracts (like DAI) that do not require allowances when the caller of
transferFrom
matches the source of the transfer. So if the community ever, for any reason (e.g., to follow the behavior of other ERC20 tokens), updates theStETH
contract and include such functionality in itstransferFrom
function, as a surprising side-effect they would be unintendedly opening up the door for anyone to arbitrarily move stETH out of the burner.I would just recommend either caution when upgrading the
StETH
contract, or to make things more explicit just add a check:which is what you're doing in the
recoverERC20
function already.The text was updated successfully, but these errors were encountered: