SynthVault rewards can be gamed
The SynthVault contract calculates a user's reward weight using the spot price of a synth token, which can be manipulated by trading in the associated liquidity pool. An attacker could inflate their weight with a small deposit and claim a disproportionate share of rewards.
Submitted by cmichel
The SynthVault._deposit function adds weight for the user that depends on the spot value of the deposit synth amount in BASE.
This spot price can be manipulated and the cost of manipulation is relative to the pool’s liquidity. However, the reward (see calcReward) is measured in BASE tokens unrelated to the pool. Therefore, if the pool’s liquidity is low and the reward reserve is high, the attack can be profitable:
- Manipulate the pool spot price of the
iSYNTH(_synth).LayerONE()pool by dripping a lot ofBASEinto it repeatedly (sending lots of smaller trades is less costly due to the path-independence of the continuous liquidity model). This increases theBASEpertokenprice. - Call
SynthVault.depositForMemberand deposit a small amount of synth token. TheiUTILS(_DAO().UTILS()).calcSpotValueInBase(iSYNTH(_synth).LayerONE(), _amount)will return an inflated weight due to the price. - Optionally drip more
BASEinto the pool and repeat the deposits - Drip back
tokento the pool to rebalance it
The user’s weight is now inflated compared to the deposited / locked-up amount and they can claim a large share of the rewards. The cost of the attack depends on the pool’s liquidity and the profit depends on the reserve. It could therefore be profitable under certain circumstances.
Recommend tracking a TWAP price of the synth instead, store the deposited synths instead, and compute the weight & total weight on the fly based on the TWAP * deposit amount instead of at the time of deposit.
verifyfirst (Spartan) acknowledged:
There is already a discussion in place to change spot rate to swap rate calculation for weights.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
The attacker could claim a large share of the rewards, and the attack could be profitable if the pool's liquidity is low and the reward reserve is high.
What the attacker needed
Ability to trade in the synth's liquidity pool; low pool liquidity relative to reward reserve
The fix
The project should track a TWAP price of the synth, store the deposited synths, and compute weight based on the TWAP times deposit amount instead of the spot price at deposit time.
How it was found
- Manipulate the pool spot price by repeatedly trading BASE for the synth token, increasing the BASE per token price.
- Call SynthVault.depositForMember with a small amount of synth token; the spot value calculation returns an inflated weight.
- Optionally repeat the price manipulation and deposits to further inflate weight.
- Trade back the synth token to the pool to rebalance it.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A vault gives rewards based on how much you deposit, but it uses the current market price of the token you deposit to decide your share. An attacker can temporarily push that price up by trading in a pool, then deposit a tiny amount to get a huge share of the rewards. This works because the reward pool is separate from the trading pool, so the attacker can profit if the reward pool is large compared to the trading pool's liquidity.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.