-
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
Claiming of token after auction is expensive #64
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-734
partial-50
Incomplete articulation of vulnerability; eligible for partial credit only (50%)
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
Comments
c4-submissions
added
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
labels
Nov 1, 2023
141345 marked the issue as duplicate of #843 |
141345 marked the issue as duplicate of #486 |
alex-ppg marked the issue as not a duplicate |
alex-ppg marked the issue as duplicate of #734 |
alex-ppg marked the issue as partial-50 |
c4-judge
added
the
partial-50
Incomplete articulation of vulnerability; eligible for partial credit only (50%)
label
Dec 8, 2023
alex-ppg changed the severity to 3 (High Risk) |
c4-judge
added
3 (High Risk)
Assets can be stolen/lost/compromised directly
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
and removed
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
labels
Dec 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-734
partial-50
Incomplete articulation of vulnerability; eligible for partial credit only (50%)
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L104-L120
Vulnerability details
Proof of Concept
When auction has started, then anyone can participate. Then in case if his bid is highest it's stored to the array.
When time is over, then winner of auction or admin, should call
claimAuction
in order to receive token.https://github.com/code-423n4/2023-10-nextgen/blob/main/smart-contracts/AuctionDemo.sol#L104-L120
This is how the function works. This function will loop through the all
auctionInfoData[_tokenid]
array and will process every bid. In case if it's a bid of the winner, then a token will be sent to him and payment will be sent to protocol(owner). In case if it's not a bid of the winner, then refund will be done in case if it wasn't done yet.Such approach is really gas consuming. One problem is that anyone can make gas griefing to make tx revert(just use all gas provided with refund payment), which will block this contract. And another problem is that if everyone is honest it's really expensive for both winner and admins to execute such tx.
Impact
Winner pays a lot of funds to execute claiming.
Tools Used
VsCode
Recommended Mitigation Steps
Change pattern, so everyone should claim and withdraw for himself.
Assessed type
Error
The text was updated successfully, but these errors were encountered: