-
Notifications
You must be signed in to change notification settings - Fork 5
Tricko - Attacker can force pause the Auction contract. #243
Comments
This is a previously known issue already proven to be not possible and incorrectly awarded in the previous audit as seen in the comments here. Additionally, even if this is possible, DAO can unpause the auction FOC, meaning the attacker would be effectively losing funds from gas to maliciously pause the contract. |
Hi @neokry @Czar102 can you double check this issue just in case. There is some code changes that i missed out from the previous C4 audit that seems to indicate this issue is possible from the PoC. But I believe this to be still invalid/lowseverity given auction can be unpaused free of charged by the DAO and no further loss of funds since users cannot bid anyways given auction did not start so the DoS is not permanent, and the malicious user would effectively be wasting gas funds to pause the auction. |
Escalate This actually seems to be a valid finding. This comment from the above linked issue from the previous C4 contest seems to explain the current situation quite well. Additionally, since each unpause action will have to go through a separate governance proposal (which usually take a couple of days), this means that the auction participants will most likely lose interest in participating in the auctions of that particular DAO (especially if the auction gets paused multiple times), in turn - leading to a loss of funds for the DAO being exploited with this vulnerability. Because of that, I believe that this issue warrants a Medium severity. |
You've created a valid escalation! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
I completely agree with @Arabadzhiew escalation. The C4 issue was actually invalid in the old codebase, but in the new current codebase its valid / a valid concern. The impact of this is IMO medium, because it requires a specific set of admin params, which are less likely to accrue in real world. For this reason I believe this issue and its duplicates are valid medium findings. Best regards! |
For this reasons this should at most be low severity. |
agree with @nevillehuang here. user also has to spend a relativly high amount of gas to execute this attack each time and realistically most DAOs have < 50% founder allocation |
Ok, first about the DOS part. For the loss of funds part. |
@Arabadzhiew Too many conditions need to be lined up for this to occur
|
I agree that both the impact from the DOS and the loss of fund issue are relatively questionable on their own, but given the fact that both of them are present with the vulnerability in question, it makes me consider it as one of a medium severity. That's my take on the matter. |
What is the minimum percentage of the tokens founders need to have for this to be an issue? @Arabadzhiew From my understanding, it can classify as medium as stopping the auction impacts protocol's core protocol functionality. But the number of assumptions here may be quite large, so I am not sure if the assumptions are reasonable. |
In this report it is stated that the minimum percentage is 51, but I can't confirm on that number. Also, yes, anyone can be an attacker here, since the |
I am not sure but in the old report the amount needed was ~26. And yes technically the DOS can last a year / every time the dao its unpaused it can be dosed again. Most of the time proposal period is set to > 2 weeks so it would cut the earnings of a DAO significantly. But yes the amount of founders tokens is quite unlikely, maybe if there is only a short auction time -> so high supply of tokens this could happen realistically. |
I believe this is a valid Medium severity issue on the grounds of impacting core protocol functionality (not DoS or loss of funds). Planning to accept the escalation. As a side note, as @nevillehuang mentioned, opportunity loss of the DAO is not a loss of funds. |
Result: |
Escalations have been resolved successfully! Escalation status:
|
Fixed here: ourzora/nouns-protocol#125 |
Fix looks good. OOG errors during minting no longer pause the contract. |
Tricko
medium
Attacker can force pause the Auction contract.
Summary
In certain situations (e.g founders have ownership percentage greater than 51) an attacker can potentially exploit the
try catch
within theAuction._CreateAuction()
function to arbitrarily pause the auction contract.Vulnerability Detail
Consider the code from
Auction._CreateAuction()
function, which is called byAuction.settleCurrentAndCreateNewAuction()
. It first tries to mint a new token for the auction, and if the minting fails thecatch
branch will be triggered, pausing the auction.Due to the internal logic of the mint function, if there are founders with high ownership percentages, many tokens can be minted to them during calls to
mint
as part of the vesting mechanism. As a consequence of this under some circumstances calls tomint
can consume huge amounts of gas.Currently on Ethereum and EVM-compatible chains, calls can consume at most 63/64 of the parent's call gas (See EIP-150). An attacker can exploit this circumstances of high gas cost to restrict the parent gas call limit, making
token.mint()
fail and still leaving enough gas left (1/64) for the_pause()
call to succeed. Therefore he is able to force the pausing of the auction contract at will.Based on the gas requirements (1/64 of the gas calls has to be enough for
_pause()
gas cost of 21572), thentoken.mint()
will need to consume at least 1359036 gas (63 * 21572), consequently it is only possible on some situations like founders with high percentage of vesting, for example 51 or more.Consider the following POC. Here we are using another contract to restrict the gas limit of the call, but this can also be done with an EOA call from the attacker.
Exploit contract code:
POC:
Impact
Should the conditions mentioned above be met, an attacker can arbitrarily pause the auction contract, effectively interrupting the DAO auction process. This pause persists until owners takes subsequent actions to unpause the contract. The attacker can exploit this vulnerability repeatedly.
Code Snippet
https://github.com/sherlock-audit/2023-09-nounsbuilder/blob/main/nouns-protocol/src/auction/Auction.sol#L238-L241
https://github.com/sherlock-audit/2023-09-nounsbuilder/blob/main/nouns-protocol/src/auction/Auction.sol#L292-L329
Tool used
Manual Review
Recommendation
Consider better handling the possible errors from
Token.mint()
, like shown below:The text was updated successfully, but these errors were encountered: