Skip to content
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.

circlelooper - Quote value can be less than minAcceptableQuoteValue #177

Closed
sherlock-admin opened this issue Jul 3, 2023 · 0 comments
Closed
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

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Jul 3, 2023

circlelooper

medium

Quote value can be less than minAcceptableQuoteValue

Summary

Quote value can be less than minAcceptableQuoteValue.

Vulnerability Detail

Every time Party A sends a quote, the lockedValues of the quote is checked to ensure its valus is no less than quote symbol's minAcceptableQuoteValue.

        require(
            lockedValues.total() >= symbolLayout.symbols[symbolId].minAcceptableQuoteValue,
            "PartyAFacet: Quote value is low"
        );

When quote is being opened, quote's lockedValues will be adjusted if quote.quantity == filledAmount and quote.orderType == OrderType.LIMIT.

                quote.lockedValues.mul(openedPrice).div(quote.requestedOpenPrice);

However, quote's lockedValues is not checked against minAcceptableQuoteValue any more, this is risky as quote's lockedValues can be less than minAcceptableQuoteValue at this time.
If it is in this case, quote will be opened with quote value being less than minAcceptableQuoteValue.

Impact

Quote is opened with its value less than minAcceptableQuoteValue.

Code Snippet

https://github.com/sherlock-audit/2023-06-symmetrical/blob/main/symmio-core/contracts/facets/PartyB/PartyBFacetImpl.sol#L158-L167

Tool used

Manual Review

Recommendation

To mitigate this vulnerability, consider checking quote's lockedValues against minAcceptableQuoteValue when quote being opened.

Duplicate of #248

@github-actions github-actions bot added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Jul 10, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Jul 26, 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