`maxTokenAmountPerUser` limit can be bypassed when currency token has less decimals than the launch token
The updateParticipation function compares token amounts and currency amounts without normalising for different decimal places, so an attacker can bypass the maxTokenAmountPerUser limit. This allows them to allocate more tokens than allowed, causing unfair distribution and potential financial loss.
056Security Follow with 0x15, 0xAlipede and 47 others
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-02-rova-judging/issues/231
Found by
056Security, 0x15, 0xAlipede, 0xAsen, 0xDemon, 0xMosh, 0xShahilHussain, 0xYjs, 0xbakeng, 0xeix, 0xiehnnkta, 0xlookman, 0xmujahid002, 0xnegan, 0xnolo, 0xpetern, 0xpranav, 10ap17, 1nc0gn170, Aamirusmani1552, Adotsam, Albort, BZ, Bbash, Bigsam, BusinessShotgun, CL001, Chain-sentry, D4n13l, DenTonylifer, DharkArtz, Elawdie, Fiifi, Flare, Harry_cryptodev, Harsh, Josh4324, Kirkeelee, Limbooo, PASCAL, POB, Praise03, Pro_King, Ragnarok, SammyOne, SarveshLimaye, Saurabh_Singh, SlayerSecurity, Waydou, X0sauce, Z-Bra, ZoA, ami, coffiasd, covey0x07, denzi_, destiny_rs, dgnnn, dobrevaleri, durov, eLSeR17, godwinudo, heeze, imkapadia, justAWanderKid, klaus, leopoldflint, marouen, merlinboii, oct0pwn, oxelmiguel, oxwhite, phoenixv110, pkabhi01, rekxor, s0x0mtee, sakibcy, smbv-1923, surenyan-oks, t0x1c, techOptimizor, tjudz, tobi0x18, tusharr1411, udo, w33kEd, web3canai, whitestrong, x0rc1ph3r, yuza101, zaiont, zatoichi0826
Summary
Due to the incorrect comparison in the function updateParticipation, an attacker can bypass the maxTokenAmountPerUser limit, allowing them to allocate more tokens than allowed.
Root Cause
The updateParticipation function in the Launch.sol contract contains a critical vulnerability due to the incorrect comparison of userTokenAmount and additionalCurrencyAmount (and refundCurrencyAmount). This comparison can lead to incorrect calculations when the payment currency and the token have different decimal places. For example, USDC has 6 decimals, while a LaunchToken might have 18 decimals. Adding these values directly without proper normalization can result in incorrect calculations, allowing an attacker to allocate more tokens than the maxTokenAmountPerUser.
https://github.com/sherlock-audit/2025-02-rova/blob/main/rova-contracts/src/Launch.sol#L355-L368
Internal Pre-conditions
Using tokens with less decimals than the token being launched.
External Pre-conditions
Attacker needs to pass checks for the launch before being able to participate.
Attack Path
An attacker can exploit this vulnerability by:
- Initiating a participation with a small amount of tokens.
- Using the
updateParticipationfunction to bypass themaxTokenAmountPerUsercheck due to the issue described above.
Impact
An attacker can bypass the maxTokenAmountPerUser limit, allowing them to allocate more tokens than allowed. This can lead to an unfair distribution of tokens and financial loss for other participants.
PoC
No response
Mitigation
Do the comparisons with request.tokenAmount .
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
Likely the code compares userTokenAmount and additionalCurrencyAmount (or refundCurrencyAmount) directly without normalising for the different decimal places of the payment currency and the launch token.
Impact
An attacker can bypass the maxTokenAmountPerUser limit, allowing them to allocate more tokens than allowed, which could lead to unfair distribution and financial loss for other participants.
What the attacker needed
Launch uses a currency with fewer decimals than the token; attacker passes launch participation checks
The fix
The comparison should be done using request.tokenAmount to avoid decimal mismatch.
How it was found
- Initiate a participation with a small amount of tokens.
- Use the updateParticipation function to bypass the maxTokenAmountPerUser check.
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.
Smart contracts often handle tokens with different numbers of decimal places, like USDC (6 decimals) and a launch token (18 decimals). The code added these numbers directly without converting them to the same scale, so the check on the maximum amount per user could be fooled. An attacker could then get more tokens than the limit allows.
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.