Closed c4-bot-7 closed 6 months ago
gzeon-c4 marked the issue as duplicate of #53
gzeon-c4 marked the issue as sufficient quality report
JustDravee marked the issue as unsatisfactory: Invalid
@JustDravee I believe this report was incorrectly duped with #53. The idea of this finding is that in vaults where IBT rate is volatile, multiple small fluctuations (e.g. 5%) in the said rate will cause losses to accumulate on the PT rate. For example, if the IBT rate alternates between increasing and decreasing in 1-0.95 range, the PT rate will decrease to 0.35, as it would be if the IBT rate decreased to the same value.
yanisepfl (sponsor) disputed
Hello @k4zanmalay @JustDravee,
I believe this report was incorrectly duped with https://github.com/code-423n4/2024-02-spectra-findings/issues/53
Correct those are not duplicates.
in vaults where IBT rate is volatile, multiple small fluctuations (e.g. 5%) in the said rate will cause losses to accumulate on the PT rate.
You are right except this is how our protocol was designed. In such a scenario, the PT worth in asset in our protocol would indeed decrease towards 0, and the YT holders will see their yield increase. Also, for such IBTs, markets should price tokens accordingly, i.e. PT traded at smaller costs than "usual" and YT traded at higher costs than "usual".
I hope that clarifies things for you.
Therefore, we dispute this issue.
JustDravee marked the issue as not a duplicate
Lines of code
https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L906-L913
Vulnerability details
Impact
Vault which IBT rate often alternates between increasing and decreasing will quickly push the principal token PT rate to a low number.
Proof of Concept
Let's look at how PT and IBT rates are updated in the
PrincipalToken.sol
If the previous IBT rate is greater than the current one, we calculate the new PT rate as
PTnew = PTold * IBTnew / IBTold
, the PT rate never increases, and can only decrease.Let's say we have a vault which IBT rate = 1 has decreased to 0.9, as a result the PT rate will be 1 0.9 / 1 = 0.9, after some time the IBT rate increased to 1 and then decreased to 0.9 again, thus decreasing PT rate even more 0.9 0.9 / 1 = 0.81. It's easy to notice that if these small fluctuations continue, the PT rate will soon go down to a small number.
Coded POC for
PrincipalToken.t.sol
It will take twenty 5 % fluctuations to decrease the PT rate to 0.34
Tools Used
Foundry
Recommended Mitigation Steps
Perhaps we need to decrease the PT rate only if the IBT rate updated it's minimum
Assessed type
ERC4626