Closed code423n4 closed 2 years ago
We don't support rebasing tokens. The FeeBurner
holds no ETH as part of normal operation. If a user randomly sends ETH to the FeeBurner
contract, it's fine if someone else randomly gets it.
Disagree that contract allows latent funds to be stolen, this is a router contract, and funds are meant to be multi-called / transferFrom into it.
Any token sent to the contract will be MEVd just like with any other router-like contract
For those reasons I believe the finding to be invalid
Lines of code
https://github.com/code-423n4/2022-05-backd/blob/2a5664d35cde5b036074edef3c1369b984d10010/protocol/contracts/tokenomics/FeeBurner.sol#L59-L65
Vulnerability details
Impact
Users that accidentally send Ether to contracts, or have rebasing rewards that the contract has stole (because it doesn't properly track rebasing tokens), have their funds (now latent) stolen, so they can't be returned by an admin.
Proof of Concept
One example is in
burnToTarget()
where the function doesn't verify thattokens_
doesn't have any duplicates. If the caller specifiesaddress(0)
(indicating Ether) twice, and provides amsg.value
exactly equal to the latent balance of the contract, the firstswapAll()
will work because of the funds actually transferred, and the secondswapAll()
will also work becausemsg.value
has the same value in a single call, no matter how many times it's checked or things change, and the funds for the actual transfer are available latently.https://github.com/code-423n4/2022-05-backd/blob/2a5664d35cde5b036074edef3c1369b984d10010/protocol/contracts/tokenomics/FeeBurner.sol#L43-L65
Tools Used
Code inspection
Recommended Mitigation Steps
Don't allow duplicate entries when allowing the user to provide arrays and track balance changes after each transfer