Submitted by nuthan2x, also found by nonseodion, DarkTower, spaghetticode_sentinel, 0xNaN, BowTiedOriole, xiao, 0xPhantom, zhaojie, hals, alexfilippov314, aslanbek, nmirchev8, Kow, and kutugu (1, 2)
https://github.com/code-423n4/2024-01-curves/blob/516aedb7b9a8d341d0d2666c23780d2bd8a9a600/contracts/Curves.sol#L236-L241 
https://gist.github.com/nuthan2x/bb0ecf745abfdc37ce374f6af0d83699#L17 
https://github.com/code-423n4/2024-01-curves/blob/516aedb7b9a8d341d0d2666c23780d2bd8a9a600/contracts/FeeSplitter.sol#L80
A subject creater can keep on claiming holder fees on every buy and sell transaction even when he doesnt hold the balance. This claiming of holder fees without holding is possible due to a combination of reentrancy and usage of call instead of transfer while transferring the subject fees.
A subject can perform this attack by:
For readable POC see below, but for full foundry setup of the poc test, copy and paste this gist to test/Test.sol directory and run forge t --mt test_Attack_POC -vvvv:
Forge testing.
Since this attack is possible for both subjects and referrers, mitigate as recommended below. Use transfer, instead of call on subject/referral fee transfers, so that only 2300 units of gas is alloted when receiving, and is not possible to perform any reentrancy attack.
Or, implement Reentrancy guard from openzeppelin library.
raymondfam (Lookout) commented:
alcueca (Judge) decreased severity to Medium and commented:
andresaiello (Curves) confirmed
