NOTE-submitting even though it is known issues, the linked audit in known issues doesnt have a dupe id issue.
After opening a short that gets filled, malicious users can supply an array of shortId's where each element is the same valid short Id to combineShorts function and steal funds.
Attacker opens a valid short and gets filled. Attacker then combines this short with itself x times, (done twice in testing). This will effectively double both the collateral value and ercDebt value in the short record, without the attacker needing to supply additional funds. Attacker then closes short and withdraws more collateral than he provided. POC provided below.
Loss of user funds
Foundry, manual review
Logs from above test:
when combining shorts, the ids array must be checked for duplicate elements. This could potentially come in the form of a modifier or a check inserted before line 123. Simply checking that the current id is different from the previous id is not enough, since the array could contain ids [1, 2, 1] which would pass the simple check.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.