LaunchToken transfers cause staking rewards to be lost to the LaunchPad
When LaunchTokens are transferred, the Distributor pays out pending staking earnings to the LaunchPad contract instead of the token holder, because it uses the wrong recipient address. A user who receives tokens can therefore lose all the staking earnings they were entitled to.
Submitted by hgrano, also found by 0rpse, 0xanony, 0xAsen, 0xAura, 0xIconart, 0xMilenov, 0xnija, 0xsagetony, 0xsai, 0xvd, air_0x, AvantGard, Ayomiposi233, Bale, BenRai, boredpukar, c0pp3rscr3w3r, ChainSentry, codegpt, deccs, derastephh, dray, dreamcoder, Egbe, Ekene, emmac002, eth_11, gizzy, HalfBloodPrince, hashbug, hecker_trieu_tien, hezze, Idealz-hacks, IvanAlexandur, jerry0422, JuggerNaut63, KuwaTakushi, Ky0toFu, levantequarini, lodelux, lufP, max10afternoon, mightyraj2605, mrMorningstar, mzfr, nem0TheFinder, Nexarion, niffylord, nonso72, nuthan2x, odeili, osok, prk0, r1ver, ret2basic, Rhaydden, roccomania, serial-coder, SeveritySquad, solhhj, The_Amazing_One, Tofu, Tough, udogodwin, unnamed, veerendravamshi, VinciGearHead, Wolf_Kalp, won, yeahChibyke, ZeroEx, and zzebra83
During LaunchToken transfers the Distributor mistakenly distributes rewards to the msg.sender (which is the LaunchPad) rather than the token holder. Consider this code execution path assuming the token is not unlocked yet:
LaunchToken::transferFromis called.LaunchToken::_beforeTokenTransferhook is executed which callsincreaseStakeon theLaunchPadcontract for thetoaccount.LaunchPadcontract will then callincreaseStakeon theDistributor.- Assuming the
toaccount has pending earnings, theDistributorthen distributes earnings to the account on lines 170 and 175 of Distributor.sol, however the transfer is done to themsg.sender- theLaunchPad- rather than thetoaccount.
Impact: partial or complete loss of staking earnings for users. As shown in the attached PoC, all it takes is for a user to send some LaunchTokens to another user and the recipient loses all of the earnings they would otherwise be entitled to.
Recommended mitigation steps
Modify lines 170 and 175 of Distributor.sol so msg.sender is replaced with the correct account.
View detailed Proof of Concept
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
Root cause
The Distributor's payout logic uses msg.sender (the LaunchPad contract calling it) as the recipient instead of the actual token holder account.
Impact
Users could partially or completely lose their staking earnings simply by receiving a LaunchToken transfer.
What the attacker needed
Token not yet unlocked; recipient has pending earnings; someone sends tokens to the recipient
The fix
Lines 170 and 175 of Distributor.sol should be changed so msg.sender is replaced with the correct account.
How it was found
- Call transferFrom on the LaunchToken contract.
- The token's before-transfer hook calls increaseStake on the LaunchPad for the recipient.
- The LaunchPad calls increaseStake on the Distributor.
- If the recipient has pending earnings, the Distributor pays them to msg.sender, the LaunchPad, instead of the recipient.
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 staking reward is a payment given to people who hold a token. Here, when tokens move from one person to another, the code that pays out those rewards sends the money to the wrong address, the platform contract, instead of the person receiving the tokens. That person then loses rewards they had earned.
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.