code-423n4 / 2021-12-yetifinance-findings

0 stars 0 forks source link

Missing cutoff checks in `adjustParams` #199

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

cmichel

Vulnerability details

The ThreePieceWiseLinearPriceCurve.adjustParams function does not check that _cutoff1 <= _cutoff2 and also does not revert in this case. However, this always indicates an error in how this function should be used.

Recommended Mitigation Steps

Add a _cutoff1 <= _cutoff2 check.

0xtruco commented 2 years ago

Fixed in line 45.