Closed code423n4 closed 1 year ago
thereksfour marked the issue as primary issue
tbrent marked the issue as sponsor confirmed
thereksfour marked the issue as satisfactory
thereksfour marked the issue as selected for report
thereksfour marked the issue as not selected for report
thereksfour marked the issue as duplicate of #23
Lines of code
https://github.com/reserve-protocol/protocol/blob/9ee60f142f9f5c1fe8bc50eef915cf33124a534f/contracts/plugins/assets/cbeth/CBETHCollateral.sol#L63
Vulnerability details
Whenever
refresh()
is called for a collateral it does a few checks, one of them is to ensure the collateral didn't depge. It does so by callingtryPrice()
and checking that the returned parameterpegPrice
(which is supposed to represent the current price of the collateral on the market) is within the limits of the peg. The issue here is thatCBETHCollateral.tryPrice()
always returns a constant 1 forpegPrice
, meaning a depeg event wouldn't be detected.Impact
Asset wouldn't be marked as iffy/disabled in case of a depeg, one of the impacts of that is that issuance would still be possible during a depeg. This would cause a loss of assets, since when the protocol would attempt to cover the deficit caused by the depeg it'd have a bigger deficit to cover for (this would probably come at the expense of RSR stakers or other RToken holders, depending on the case).
Proof of Concept
tryPrice()
returnstargetPerRef
forpegPrice
:targetPerRef
always returns 1:Recommended Mitigation Steps
Use an oracle for
pegPrice
Assessed type
Other