Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

libratus - Inconsistent calcuation of token address limit #393

Closed
github-actions bot opened this issue Feb 21, 2023 · 0 comments
Closed

libratus - Inconsistent calcuation of token address limit #393

github-actions bot opened this issue Feb 21, 2023 · 0 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@github-actions
Copy link

github-actions bot commented Feb 21, 2023

libratus

medium

Inconsistent calcuation of token address limit

Summary

Token address limit depends on the order in which tokens are sent to the bounty. If whitelisted tokens are added first, non-whitelisted will fail.

Vulnerability Detail

It should be possible to fund bounty with non-whitelisted tokens. However, this may fail if whitelisted tokens are deposited first.

Function tokenAddressLimitReached gets the number of token addresses deposited to the bounty. This number, however, contains both whitelisted and non-whitelisted tokens. If the number of deposited whitelisted tokens reaches TOKEN_ADDRESS_LIMIT, it will not be possible to add non-whitelisted tokens to the bounty.

Impact

Users may deposit some whitelisted tokens and then realize that non-whitelisted can't be added. The ones they deposited are now stuck until expiry.

Code Snippet

https://github.com/sherlock-audit/2023-02-openq/blob/main/contracts/DepositManager/Implementations/DepositManagerV1.sol#L207-L217

Tool used

Manual Review

Recommendation

Only check for a number of non-whitelisted tokens deposited to the bounty when enforcing token address limit

Duplicate of #530

@github-actions github-actions bot added Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue labels Feb 21, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Mar 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant