The cancelParticipation function refunds the user's original stakedAsset amount, not the proportional value of their shares. An attacker can donate assets to the vault to inflate the share value, then wait for a user to cancel, effectively acquiring the appreciated value from them.
Normal Behavior: A user who calls cancelParticipation function expects to get their deposited funds back less the fee they already paid.
The Problem: The cancelParticipation function burns the user's shares but only refunds them their original stakedAsset amount. If the vault's assets have increased, the shares are worth more than the original stake so the user is refunded but loses all the appreciated value.
Likelihood: High
Reason 1: The attack is simple and can be executed by anyone.
Reason 2: The attacker would call transfer to donate assets and then simply waits for any user to call cancelParticipation
Impact: High
Impact 1: Direct loss of funds for any user who calls cancelParticipation
Impact 2: The value not sent to the user is left orphaned in the vault, which the attacker can then claim by using the inflation attack
This test shows a victim's shares appreciating after a donation, but cancelParticipation only refunds them their original stake.
The function cancelParticipation should be removed and a user wishing to exit their position before the event starts should use the standard redeem or withdraw functions, which would correctly calculate their proportional share of the total assets.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.