Platform: Code4rena
Start Date: 13/02/2024
Pot Size: $24,500 USDC
Total HM: 5
Participants: 84
Period: 6 days
Judge: 0xA5DF
Id: 331
League: ETH
Rank: 79/84
Findings: 1
Award: $7.18
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: BowTiedOriole
Also found by: 0x0bserver, 0xAadi, 0xJoyBoy03, 0xlamide, 0xlemon, 0xpiken, Babylen, Breeje, Brenzee, CodeWasp, DanielArmstrong, DarkTower, Fassi_Security, Fitro, Honour, JohnSmith, Krace, MrPotatoMagic, Myrault, ReadyPlayer2, SovaSlava, SpicyMeatball, TheSavageTeddy, Tigerfrake, atoko, cryptphi, csanuragjain, d3e4, gesha17, kinda_very_good, krikolkk, matejdb, max10afternoon, miaowu, n0kto, nuthan2x, parlayan_yildizlar_takimi, peanuts, petro_1912, pontifex, psb01, pynschon, rouhsamad, shaflow2, slippopz, spark, turvy_fuzz, web3pwn, zhaojohnson
7.1828 USDC - $7.18
Attacker will recieve multiple disbursement in the distribute funtion with just one account.
This issue occures _beforeTokenTransfer() which checks if the balance of reciever is 0 and then add him to holders array https://github.com/code-423n4/2024-02-althea-liquid-infrastructure/blob/bd6ee47162368e1999a0a5b8b17b701347cf9a7d/liquid-infrastructure/contracts/LiquidInfrastructureERC20.sol#L127-L146 . The flaw is it does not check if the reciever is still a pre-existing holder (i.e part of the holder array) thereby duplicating the users address in the holder array. User can burn his token directly on the erc20 contract since the burn function is not overiden (reimplented) and still have his approveHolder set to true, and then he'll have another user send him dust tokens. He'll keep repeating the step and have his address duplicated multiple times in the holders array.
example
user burns his token balance directly on the tokem contract setting his balance to 0, and he is still an approved holder. (this will be called from the erc20 token contract)
he'll then have another holder send him dust token which duplicates his address to the holders array without checking if his address is already there before as seen there in _beforeTokenTransfer() https://github.com/thegamepro21/tcoin/blob/7d5f0498a2f8bc2eeac1a421ceb88deec3748202/LiquidInfrastructureERC20.sol#L142-L145
3 He then burns the dust token and repeat process.
Manual Review
Consider reimplenting the burn function and adding check to remove the users from holder array if they burn all thier tokens
Context
#0 - c4-pre-sort
2024-02-22T06:46:49Z
0xRobocop marked the issue as duplicate of #77
#1 - c4-judge
2024-03-04T13:23:37Z
0xA5DF marked the issue as satisfactory