Open smartsmartsec opened 7 months ago
Hi @smartsmartsec please utilize our bug bounty program through immunefi for issues such as this: https://docs.cove.finance/security/bug-bounty. Also this same tool has created issues today as well and has closed them in preparation to add them to the bug bounty program
Impact
lpSupply
to zero can trigger a division by zero, causing transaction failures and potentially halting the reward distribution process.lpSupply
can dilute the reward per share, leading to reduced rewards for honest participants and undermining the economic incentives of the system.Affected component(s)
function
pendingReward
in MiniChefV3.solAttack vector(s)
An attacker can manipulate the
lpSupply
value through direct interactions with the contract or through other contracts that interact with it, affecting the division operation used in reward calculations.Suggested description of the vulnerability for use in the CVE
The vulnerability identified in the smart contract's reward calculation mechanism could lead to severe consequences if exploited on the production/mainnet. The flaw centers around the manipulation of the
lpSupply
state variable, crucial for computing users' rewards. WhenlpSupply
is manipulated to approach zero, it allows attackers to disproportionately increase the reward per share calculation, leading to massive undue earnings. This exploitation not only disrupts the reward distribution but can also result in significant financial losses for other participants.Discoverer(s)/Credits
xFuzz
Proposed Solution
lpSupply
Adjustments: Implement stringent checks to validate any adjustments tolpSupply
, ensuring that modifications are only possible through secure, predefined paths. This includes validating inputs and state changes to prevent unauthorized manipulations.lpSupply
value at the start of each transaction and using this cached value throughout the reward calculation.lpSupply
management. Implement monitoring systems to alert developers and administrators of unusual activities or discrepancies inlpSupply
.Reference(s)