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
Attacker can perform DOS on any bounty contract by over calling fundBountyToken() with different tokens
Summary
Attacker can create multiple number of deposits with small amount and short durations and Bounty would reach the token address limit and attacker would prevent real issuer from depositing and funding the Bounty. some Deposits would be locked for deposit time for nothing and issued Bounty would be useless.
Vulnerability Detail
Function fundBountyToken() is for depositing funds into the bounty and it is callable by anyone. when deposits accrue for a bounty, Bounty contract add it to deposits and add token address to tokenAddresses in the BountyCore.receiveFunds() function. attacker can call fundBountyToken() for a bounty a couple of time with different white listed token addresses and make that bounty to reach the limit and then issuer can't fund the bounty. it's a DOS and griefing attack as some deposit funds would stuck in the contract for deposit time and Bounty contract won't be usefull.
This is fundBountyToken() code:
As you can see code checks tokenAddressLimitReached(_bountyAddress) to be false, and that function returns true if the total number of unique tokens deposited on then bounty is greater than the OpenQWhitelist TOKEN_ADDRESS_LIMIT.
and then code calls bounty.receiveFunds() which is:
create two limit for deposit tokens. one for issuer and one for others. in this way issuer can always deposit tokens even if others deposits small amounts before him.
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
unforgiven
medium
Attacker can perform DOS on any bounty contract by over calling fundBountyToken() with different tokens
Summary
Attacker can create multiple number of deposits with small amount and short durations and Bounty would reach the token address limit and attacker would prevent real issuer from depositing and funding the Bounty. some Deposits would be locked for deposit time for nothing and issued Bounty would be useless.
Vulnerability Detail
Function
fundBountyToken()
is for depositing funds into the bounty and it is callable by anyone. when deposits accrue for a bounty, Bounty contract add it todeposits
and add token address totokenAddresses
in theBountyCore.receiveFunds()
function. attacker can callfundBountyToken()
for a bounty a couple of time with different white listed token addresses and make that bounty to reach the limit and then issuer can't fund the bounty. it's a DOS and griefing attack as some deposit funds would stuck in the contract for deposit time and Bounty contract won't be usefull.This is
fundBountyToken()
code:As you can see code checks
tokenAddressLimitReached(_bountyAddress)
to be false, and that function returns true if the total number of unique tokens deposited on then bounty is greater than the OpenQWhitelist TOKEN_ADDRESS_LIMIT.and then code calls
bounty.receiveFunds()
which is:which adds the deposit tokens to
tokenAddresses
set. so attacker can perform this steps:TOKEN_ADDRESS_LIMIT
is 10.tokenAddresses
and code won't allow deposits.Impact
attacker can cause griefing and DOS and temporary fund lock.
Code Snippet
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/DepositManager/Implementations/DepositManagerV1.sol#L45-L50
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/DepositManager/Implementations/DepositManagerV1.sol#L207-L217
https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/Bounty/Implementations/BountyCore.sol#L55
Tool used
Manual Review
Recommendation
create two limit for deposit tokens. one for issuer and one for others. in this way issuer can always deposit tokens even if others deposits small amounts before him.
Duplicate of #530
The text was updated successfully, but these errors were encountered: