DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: low
Invalid

Recycle of short ids can lead to conflicts

Summary

Short IDs are recycled and reused when short position are canceled or closed. This might causes inconsistencies or causes conflicts.

Vulnerability Details

in the Library contract LibShortRecord.sol , the function setShortRecordIDs L227-L281.
The function checks if there are previously cnaceled short positions and reuse their IDs when available. In case if its not canceled it increments the ID to create a new short record. Although this mechanism might optimize gas usage but in case if the number of the short ids exceeds this might introduce race condition.

Impact

The impact could lead to data integrity problems, when the short id is reused it may still be referenced for example in LibOrder.sol library, this could result in data inconsistency. Also if the short record id s used quickly this could introduce race condition.

Tools Used

Manual Analysis

Recommendations

Ensure proper management of recycle short ids and implement time-delay mechanism for short id reuse.

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: User experience and design improvement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.