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 Jan 7, 2024. It is now read-only.
sherlock-admin opened this issue
Jul 3, 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
PartyBFacetImpl.openPosition can open position that is not solvent
Summary
PartyBFacetImpl.openPosition can open position that is not solvent. This is because it checks solvency based on original locked values, but they can be adjusted if partyB price is not same as quote price.
Vulnerability Detail
When qoute is open, then user provides price, that he would like to get. Also his provided lockedValuesare stored to quote. Then his pending locking balance is increased with locked values.
However partyB price can be not same as provided by partyA. Because of that, locked values that back this position can be scaled.
When position is going to be open, then check is done, that it will not make any party insolvent. This check is done before locked values rescaling.
As you can see quote.lockedValues are used to determine solvency.
But this quote.lockedValues are original one(set when quote is created) and it can be changed later(if price of partyB is not same as quote price). They can be increased for example. In this case solvency check will show that partyA is solvent and open position. After that partyA already can be liquidatable.
This is because solvency check should be done after rescaling of quote's locked values.
Impact
PartyBFacetImpl.openPosition can open position that is not solvent
Code Snippet
Provided above
Tool used
Manual Review
Recommendation
Solvency check should be done after rescaling of quote's locked values.
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
rvierdiiev
high
PartyBFacetImpl.openPosition can open position that is not solvent
Summary
PartyBFacetImpl.openPosition can open position that is not solvent. This is because it checks solvency based on original locked values, but they can be adjusted if partyB price is not same as quote price.
Vulnerability Detail
When qoute is open, then user provides price, that he would like to get. Also his provided
lockedValues
are stored to quote. Then his pending locking balance is increased with locked values.However partyB price can be not same as provided by partyA. Because of that, locked values that back this position can be scaled.
When position is going to be open, then check is done, that it will not make any party insolvent. This check is done before locked values rescaling.
https://github.com/sherlock-audit/2023-06-symmetrical/blob/main/symmio-core/contracts/libraries/LibSolvency.sol#L31-L44
As you can see
quote.lockedValues
are used to determine solvency.But this
quote.lockedValues
are original one(set when quote is created) and it can be changed later(if price of partyB is not same as quote price). They can be increased for example. In this case solvency check will show that partyA is solvent and open position. After that partyA already can be liquidatable.This is because solvency check should be done after rescaling of quote's locked values.
Impact
PartyBFacetImpl.openPosition can open position that is not solvent
Code Snippet
Provided above
Tool used
Manual Review
Recommendation
Solvency check should be done after rescaling of quote's locked values.
Duplicate of #225
The text was updated successfully, but these errors were encountered: