-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bidder Funds Can Become Unrecoverable Due to 1 second Overlap in participateToAuction()
and claimAuction()
#175
Comments
141345 marked the issue as duplicate of #962 |
alex-ppg marked the issue as not a duplicate |
alex-ppg marked the issue as duplicate of #1926 |
alex-ppg marked the issue as selected for report |
The Warden has clearly specified what the vulnerability is, has provided a recommended course of action that aligns with best practices, and has specified all aspects of the contract that would fail for the user if they tried to reclaim their lost funds. The likelihood of this exhibit manifesting in practice is relatively low (requires a The impact is high as the funds of the user are irrecoverably lost even with administrative privileges as no rescue mechanism exists, rendering this exhibit a medium severity issue. |
alex-ppg marked the issue as satisfactory |
Hi @ZdravkoHr, I disagree that these both have the same root cause. The issue here is that "<=" is used instead of "<" in |
Hey @alex-ppg, I think this should be partial of #1323. The warden identified the root cause but didn't cover the full impact. Otherwise you should consider splitting re-entrancies and back-running attacks into separate issues. Regarding the warden's above comment, fixing #1323 will fix this as there aren't two mitigations; they're the same and the sponsor needs to apply them both to fix #1323. |
Hey @ZdravkoHr, @mcgrathcoutinho, and @0xbtk; thanks a lot for your feedback! I will attempt to address everyone's response in this reply. Root CauseThe project contained multiple vulnerabilities that can be argued to have the same root cause. The root cause of this submission is that it is possible to participate in an auction beyond its end. As @mcgrathcoutinho specified earlier, this is a distinct case as #1323 does not rely on the If we know both issues, of course, we can say that the expected remediation is to simply code Re-EntranciesRe-entrancies are indeed split into separate attacks. You can observe this by evaluating #1597 and #1517 which use the same re-entrancy origin differently. In general, a re-entrancy attack's root cause is the absence of the CEI pattern; not the re-entrancy itself which is a trait of the EVM. If there are instances where you believe re-entrancy attacks have been merged incorrectly, please flag them and I will review them. Back-RunningBack-running attacks and re-entrancy attacks are the same when it comes to this particular exhibit. A back-running attack is the prime vulnerability / root cause because the time overlap permits a cancellation to occur at the same timestamp as a claim. If we fix re-entrancy, we will not fix the back-running attack but if we fix the back-running attack the re-entrancy will no longer be possible. As such, re-entrancy is simply a tool via which time inconsistency is exploited. Whether you choose to exploit it via a re-entrancy or a back-running attack; they are equivalent. If you mention re-entrancy guards as the correct fix, however, your submission will be penalized. Please let me know if you have any further concerns. |
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L57
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L104
Vulnerability details
Impact
Bidder funds may become irretrievable if the
participateToAuction()
function is executed afterclaimAuction()
during a 1-second overlap.Proof of Concept
The protocol allows bidders to use the
participateToAuction()
function up to the auction's end time.However, the issue arises when an auction winner immediately calls
claimAuction()
right after the auction concludes, creating a 1-second window during which bothclaimAuction()
andparticipateToAuction()
can be executed.The issue arises when
claimAuction()
is executed beforeparticipateToAuction()
within this 1-second overlap. In such a scenario, the bidder's funds will become trapped inAuctionDemo.sol
without any mechanism to facilitate refunds. BothcancelBid()
andcancelAllBids()
functions will revert after the auction's conclusion, making it impossible for bidders to recover their funds.Tools Used
Manual Review
Recommended Mitigation Steps
Assessed type
Context
The text was updated successfully, but these errors were encountered: