Closed c4-submissions closed 1 year ago
seems invalid
past rewards are not expected to chagne, front run can not profit
141345 marked the issue as primary issue
141345 marked the issue as low quality report
OpenCoreCH (sponsor) disputed
dmvt marked the issue as unsatisfactory: Invalid
I strongly believe that this should be considered a valid low-severity issue because the root cause of this problem is the same as issue #284 (changing rewards ratios before the week is over and altering past rewards). Additionally, I have provided a detailed attack scenario.
@dmvt @141345
@radeveth changing it from invalid medium to valid low risk won't change anything about the scoring or cause it to be included in the report.
I don't think this is valid the way described, but for future contests, a functioning test may have been able to convince me otherwise. Your fix is also one of our classic QA suggestions so overinflated severity could also be applied here. Finally, the fix doesn't change anything as users are already aware of governance actions via voting. A delay would not provide for a higher level of warning than simply following the results of the vote. Once again though, changing this to a grade-a QA report wouldn't change your score, payout, or cause it to be included in the report.
Lines of code
https://github.com/code-423n4/2023-10-canto/blob/main/canto_ambient/contracts/callpaths/LiquidityMiningPath.sol#L65-L81 https://github.com/code-423n4/2023-10-canto/blob/main/canto_ambient/contracts/mixins/LiquidityMining.sol#L156-L196 https://github.com/code-423n4/2023-10-canto/blob/main/canto_ambient/contracts/mixins/LiquidityMining.sol#L256-L289
Vulnerability details
Impact
Malicious users claim rewards at a higher rate than what was intended by front-running governance actions meant to reduce rewards. This allows them to claim rewards at a higher rate than what was intended, undermining the protocol's intended economic incentives and potentially causing undue inflation.
Proof of Concept
Attack Scenario:
Monitoring for Reward Update Transactions: An malicious user sets up a bot or script to monitor pending transactions sent from the governance address or any transaction calling
setConcRewards
orsetAmbRewards
. This can be done using tools like Etherscan's API or Web3 libraries to listen to mempool transactions.Identification of the Reduction: Once the user's script identifies a transaction intending to reduce the rewards, it triggers the next steps automatically.
Swift Claiming: The malicious user immediately sends a transaction calling
claimAmbientRewards
orclaimConcentratedRewards
. To ensure their transaction gets processed first, they set a gas price significantly higher than the current average or the gas price of the governance's transaction.Transaction Confirmation: Given the higher gas price, miners prioritize the malicious user transaction over the governance's reward adjustment transaction. As a result, the malicious user claim transaction gets confirmed first, allowing them to receive rewards at the old, higher rate.
Result: By the time the governance transaction gets confirmed and the reward rate is reduced, the malicious user has already claimed a significant portion of the rewards at the higher rate. Over time and repeated instances, this can lead to substantial losses for the protocol.
Evidence:
Code Snippet
setConcRewards()
andsetAmbRewards()
functions are used to set the weekly reward rate for the liquidity mining sidecar. Reward rates are set by determining a total amount that will be disbursed per week. Governance can choose how many weeks that the reward rate will be set for.Tools Used
Manual Inspection
Recommended Mitigation Steps
Time-Locked Updates: Introduce a delay on governance actions that adjust rewards, providing users with a clear window of upcoming changes.
Assessed type
Other