Open c4-bot-10 opened 10 months ago
raymondfam marked the issue as sufficient quality report
raymondfam marked the issue as duplicate of #51
raymondfam marked the issue as insufficient quality report
raymondfam marked the issue as not a duplicate
raymondfam marked the issue as primary issue
data.userFeeOffset[account] = data.cumulativeFeePerToken will take care of it when updateFeeCredit() is triggered in claimFees(). You can only do it once. Additionally, this method pales in comparison to the #41 & #222 attacking path.
data.userFeeOffset[account] = data.cumulativeFeePerToken will take care of it when updateFeeCredit() is triggered in claimFees().
andresaiello (sponsor) disputed
alcueca marked the issue as satisfactory
alcueca marked issue #1211 as primary and marked this issue as a duplicate of 1211
You can do it once per each buy/sell cycle, as I understand.
alcueca marked the issue as selected for report
alcueca removed the grade
Issues related to loss of fees, and not loss of principal, are Medium.
alcueca changed the severity to 2 (Med Risk)
talked offline with alcueca, looks valid
andresaiello (sponsor) confirmed
Lines of code
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
Vulnerability details
Impact
A subject creater can keep on claiming holder fees on every buy and sell transaction even when he doesn't hold the balance.
This claiming of holder fees without holding is possible due to a combination of reentrancy and usage of
call
instead oftransfer
while transferring the subject fees.A subject can perform this attack by
Proof of Concept
test/Test.sol
directory and runforge t --mt test_Attack_POC -vvvv
Tools Used
Manual review and forge testing
Recommended Mitigation Steps
transfer
, instead ofcall
on subject/referral fee transfers.2300
units of gas is alloted when receiving, and is not possible to perform any reentrancy attack.Assessed type
Reentrancy