Open code423n4 opened 2 years ago
Non critical as documentation is incorrect about this
Downgrading to Med
as it's mostly because the documentation is incorrect.
@jack-the-pug The docs have been updated to explain the correct burned amount.
@jack-the-pug The docs have been updated to explain the correct burned amount.
Thank you @rcstanciu
While I agreed that the issue only impacts a small sum of users and the impact is not significant. And the root cause of this issue may not be a wrong implementation but actual wrong documentation.
However, I still tend to make this a Med
rather than a Low
for the following reasons:
Therefore, I'm keeping this as a Med
and I encourage the future wardens to continue finding the inconsistency between the documentation and the implementation.
Keep up the good work! GreyArt is a great name btw.
Handle
GreyArt
Vulnerability details
Impact
When escalating claims, the documentation states that the protocol agent is required to pay and stake a certain amount for the process. If the covered protocol is proven correct, then the amount specified by the claim will be paid out. They will also receive the stake amount back in full. If the covered protocol's escalation is not successful, then the amount specified by the claim is not paid out and the stake amount is not returned.
The protocol agent is reasonably expected to pay the following:
BOND
) andIn reality, the protocol agent will end up paying more, as we shall see in the proof of concept.
Proof of Concept
Let us assume the following:
BOND = 9600
as defined inSherlockClaimManager
umaFee = 400
(at the time of writing, this value has been updated to 1500 USDC: see[Store.computeFinalFee(usdc)](https://etherscan.io/address/0x54f44eA3D2e7aA0ac089c4d8F7C93C27844057BF#readContract)
).On invoking
escalate()
, the following amounts are required:BOND + umaFee = 9600 + 400
will be transferred to UMA when invokingrequestAndProposePriceFor()
BOND + umaFee = 9600 + 400
will be transfered when invokingdisputePriceFor()
However, what’s important to note is that UMA will “burn” half of the BOND collected + final fee. This will go against the claim that the protocol agent will be able to reclaim his stake in full.
We finally note that on settlement, the eventual payout is
Hence, in reality, the protocol agent will only receive
9600 * 2 - 4800 + 400 = 14800
should the dispute be successful. We note that the burnt amount of4800 / 2 + 400 = 5200
has been taken by UMA.One can further verify this behaviour by looking at a past resolution of another protocol:
https://dashboard.tenderly.co/tx/main/0x0f03f73a2093e385146791e8f2739dbc04b39145476d6940776680243460100f/debugger?trace=0.6.1
The above example has a bond is
0.0075 ETH
, with UMA’s final fee being 0.2 ETH. We see that UMA takes0.2 + 0.5 * 0.0075 = 0.02375 ETH
.Thus, we see that the protocol agent will be charged disproportionally to what is expected.
Recommended Mitigation Steps
We suggest changing the parameters of
requestAndProposePriceFor()
towhere
BOND
becomes the reward and the actual bond for UMA is1
. Ideally, it should be set to 0, but if set as such, UMA interprets it to use the final fee as the bond amount instead.[request.bond = bond != 0 ? bond : finalFee;](https://github.com/UMAprotocol/protocol/blob/master/packages/core/contracts/oracle/implementation/SkinnyOptimisticOracle.sol#L321)
This way, the actual amount required from the protocol agent is the
BOND + 2 * (USDC wei + umaFee)
for the process. He will additionally be returned hisBOND + umaFee
if his dispute is successful.