QA Report #313
Labels
bug
Warden finding
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Buyout can be considered successful with less than 51% of tokens in pool
Impact
It is possible to move the state to
success
by having only 50.1% of the total circulating tokens in the pool.The documentation for
end()
states, "if the current pool has at least 51% of the total circulating supply, then the buyout is considered a success. The remaining fractions in the pool are then burned, allowing the proposer to safely withdraw the underlying assets from the vault."However, it is possible to call
end()
and move the state toSUCCESS
by having only 50.1% of the total circulating tokens in the pool.Proof of Concept
For example, assume
tokenBalance == 50_100
andIVaultRegistry(registry).totalSupply(_vault) == 100_000
. Using these values in the formula below, the result is 501 which equates to 50.1% of the total circulating supply.Below is a simple fuzz test to validate the percentage formula.
Tools Used
VSCode, Foundry
Recommended Mitigation Steps
Consider changing the code in the above if-block to be
> 509
or alternatively>= 510
for improved readability and a small increase in gas used.===========================================================================
Lack of input validation for array length
Impact
In Vault the
install
function does not validate the passed array lengths which may lead to unintended storage outcomes.The same issue is present in the BaseVault batch deposit functions:
batchDepositERC20
,batchDepositERC721
andbatchDepositERC1155
.Proof of Concept
In Vault, if a caller passes one bytes4
_selectors
and two_plugins
addresses toinstall()
then the second_plugins
address will not be registered to amethods
mapping. This is because the for loop iterates based on the length of the_selectors
array.Tools Used
Manual analysis
Recommended Mitigation Steps
Consider adding
require
statements in functions to validate user-controlled data input and to ensure that array lengths are equal.Discrepancy between documentation and code
Impact
The documentation for the Buyout module states that "A fractional owner starts an auction for a vault by depositing any amount of ether and fractional tokens into a pool."
However, in
start()
the amount of fractional tokens a user must deposit is the entire balance ofmsg.sender
.link to depositAmount
Proof of Concept
N/A
Tools Used
Manual Analysis
Recommended Mitigation Steps
Update the documentation to make it clear that a user is required to deposit all of their fractional tokens into a pool.
The text was updated successfully, but these errors were encountered: