Buoy3Pool.safetyCheck
is not precise and has some assumptions
#104
Labels
Buoy3Pool.safetyCheck
is not precise and has some assumptions
#104
Handle
cmichel
Vulnerability details
Vulnerability Details
The
safetyCheck
function has several issues that impact how precise the checks are:only checks if the
a/b
anda/c
ratios are withinBASIS_POINTS
.By transitivity
b/c
is only within2 * BASIS_POINTS
ifa/b
anda/c
are in range.For a more precise check whether both USDC and USDT are within range,
b/c
must be checked as well.If
a/b
is within range, this does not imply thatb/a
is within range.Example:
lastRatio = 1.0
ratio: a = 1.0, b = 0.8
=>a/b = 1.25
,b/a = 0.8
If
a/b
was used with a 20% range, it'd be out of range, butb/a
is in range._ratio
andlastRatio
are only from Curve. Only_updateRatios
checks the oracle.Recommended Mitigation Steps
In addition, check if
b/c
is withinBASIS_POINTS
.The text was updated successfully, but these errors were encountered: