You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 26, 2023. It is now read-only.
github-actionsbot opened this issue
Feb 21, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
Malicious increase in the number of NFT, resulting in normal funder can not deposit nft.
Vulnerability Detail
For OUT_OF_GAS attacks, when depositing NFT, the total number cannot be greater than nftDepositLimit
At present, nftDepositLimit is 5, and it cannot be modified
function receiveNft(
address_sender,
address_tokenAddress,
uint256_tokenId,
uint256_expiration,
bytescalldata
) external onlyDepositManager nonReentrant returns (bytes32) {
require(
nftDeposits.length< nftDepositLimit, //@audit <-------nftDepositLimit is 5, and no way to modify
Errors.NFT_DEPOSIT_LIMIT_REACHED
);
And after the nft refund, the quantity will not be reduced by 1
So if a malicious user executes 5 times: deposit NFT (any in the whitelist), refund the NFT, the issuer will no longer be able to deposit normal NFT
For example:
alice deploy bounty
alice posts information to social media to let others know about the event
Malicious user bob call fundBountyNFT() nft = any nft in whitelist
, _expiration=1 second
The next transaction (after 12 seconds) bob executes refundDeposit
bob repeat 5 times (step 3,4), only need 60 seconds
When the event is about to end, alice wants to deposit NFT, but finds that she cannot deposit because
nftDeposits.length> nftDepositLimit
suggested to skip this quantity limit if msg.sender is bounty issuer.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
bin2chen
medium
nftDepositLimit attack
Summary
Malicious increase in the number of NFT, resulting in normal funder can not deposit nft.
Vulnerability Detail
For OUT_OF_GAS attacks, when depositing NFT, the total number cannot be greater than nftDepositLimit
At present, nftDepositLimit is 5, and it cannot be modified
And after the nft refund, the quantity will not be reduced by 1
So if a malicious user executes 5 times: deposit NFT (any in the whitelist), refund the NFT, the issuer will no longer be able to deposit normal NFT
For example:
, _expiration=1 second
suggested to skip this quantity limit if msg.sender is bounty issuer.
Impact
normal funder can not deposit nft.
Code Snippet
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/AtomicBountyV1.sol#L132-L135
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/OngoingBountyV1.sol#L133
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/TieredBountyCore.sol#L25-L28
Tool used
Manual Review
Recommendation
Duplicate of #262
The text was updated successfully, but these errors were encountered: