-
Notifications
You must be signed in to change notification settings - Fork 8
elhaj - Unfair Manipulation of Winning Chances Due to Stolen Yield on Blast
#114
Comments
The blast docs here state that:
The docs say the default for EOAs is rebasing, but the default for the contracts like the prize pool will be void. |
@trmid that's not true that's the case for native ETH not WETH here a quote from docs in case of WETH:
|
Blast
Blast
The protocol team fixed this issue in the following PRs/commits: |
Fixed |
The Lead Senior Watson signed off on the fix. |
elhaj
medium
Unfair Manipulation of Winning Chances Due to Stolen Yield on
Blast
Summary
PoolTogether
protocol on Blast will useWETH
as it's prize token as mentioned by sponsor, which generates yield over time. This yield can be stolen and used to manipulate the vaults' winning chances unfairly. By contributing the stolen yield to their own vault, users can inflate their vault's portion, increasing their chances of winning prizes while decreasing the chances for other legitimate users. This undermines the fairness of the prize distribution.Vulnerability Detail
PoolTogether
protocol will be deployed on Blast, and as the sponsor mentioned,WETH
will be the prize token.WETH
on Blast is a rebasing token that automatically generates yield over time.WETH
holders have three Yield Modes for rebasing:Void
,Automatic
, andClaimable
. The Default mode isAutomatic
, which means the balance will increase over time by the yield generated.WETH
as the prize token and will generate yield over time. However, this yield can be stolen by anyone, as they can contribute it to their own vault by calling thecontributePrizeTokens()
function, passing their vault and the amount of yield generated.The idea is that this yield is generated from all vault contributions. However, a malicious user can exploit this feature to their advantage. While this might be considered a missing feature (not benefiting from yield) in different protocol contexts, within the
PoolTogether
on Blast scenario, it has a detrimental effect. The malicious user's ability to exploit the yield generation artificially inflates their vault's portion compared to other vaults. This act will decrease other vaults portions consequently increases the malicious user vault portion, thus increase his chances of winning prizes and decrease others chances.For the malicious user's vault, the increase in their contribution portion will lead to a higher
winning zone
thus more chances to win. Conversely, for other vaults, the decrease in their contribution portions will lead to a smallerwinning zone
reducing their chances of winning.This manipulation undermines the fairness of the prize distribution. Not only will the yield be stolen from all vaults contributions and not be spread to them proportionally, but it will also affect their winning chances by decreasing them. This gives the malicious user an unfair advantage by increasing their likelihood of winning at the expense of others.
Scenario
Normal Case
vault1.contributionBetween = 100
vault2.contributionBetween = 100
totalContributionBetween = 200
v1.portion = 100 / 200 = 0.5
v2.portion = 100 / 200 = 0.5
winningZone(vault1[user]) = 500 * 0.5 = 250
winningZone(vault2[user]) = 500 * 0.5 = 250
Yield Stolen Case
When we get the contribution of
vault3
(malicious vault) for this period (from draw 4 to 40), we get:vault3.contribution = 50
Now let's recalculate the vaults' portions again:
vault1.contributionBetween = 100
vault2.contributionBetween = 100
vault3.contributionBetween = 50
totalContributionBetween = 250
To calculate their portions:
v1.portion = 100 / 250 = 0.4
v2.portion = 100 / 250 = 0.4
v3.portion = 50 / 250 = 0.2
winningZone(vault1[user]) = 500 * 0.4 = 200
winningZone(vault2[user]) = 500 * 0.4 = 200
winningZone(vault3[maliciousUser) = 500 * 0.2 = 100
Notice how the malicious user now has a chance to win without any contribution from it's vault (only stolen yield), and how legitimate users vaults' chances have decreased.
Impact
Code Snippet
Tool used
manual review
Recommendation
Blast
, configure the yield mode toClaimable
in the constructor so it doesn't affect thebalanceOf()
. Expose a public function that claims this yield and contributes it to theDONATOR
address. This way, the yield is not wasted, and all contributors benefit from it. Contributors will be incentivized to call this function since it increases the prize size.The text was updated successfully, but these errors were encountered: