You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Incorrect Denominator Scaling in Kappa Calculation Leading to Inflation of Kappa Result
Summary
The _calculateKappa function in the DistributionModule incorrectly scales the denominator due to the use of BPS_SCALAR (10^4) instead of the required 10^5 scaling factor. This discrepancy inflates the resulting Kappa value, leading to incorrect token distribution calculations and break of proper protocol functionality.
Here, BPS_SCALAR is defined as 10^4, but the comment indicates that the scaling should be 10^5. This mismatch results in a denominator that is 10 times smaller than intended, inflating the Kappa value by a factor of 10.
Mitigation
Protocol should update the denominator calculation to use the correct scaling factor of 10^5 instead of 10^4 as noted in comment description.
Bitter Ash Mink
Medium
Incorrect Denominator Scaling in Kappa Calculation Leading to Inflation of Kappa Result
Summary
The _calculateKappa function in the DistributionModule incorrectly scales the denominator due to the use of BPS_SCALAR (10^4) instead of the required 10^5 scaling factor. This discrepancy inflates the resulting Kappa value, leading to incorrect token distribution calculations and break of proper protocol functionality.
Root Cause
https://github.com/sherlock-audit/2025-02-usual-labs/blob/main/pegasus/packages/solidity/src/distribution/DistributionModule.sol#L928
The root cause lies in the denominator calculation within the _calculateKappa function. The comment explicitly states that the denominator should follow a scaling system of 1018 * 105 / 105 = 1018. However, the implementation uses BPS_SCALAR (10^4) instead of the required 10^5 scaling factor. This mismatch causes the denominator to be smaller than intended, inflating the Kappa value.
Internal Pre-conditions
The _calculateKappa function is invoked during token distribution calculations.
The rate0 and _calculateGamma($) values are non-zero and valid.
External Pre-conditions
The system relies on accurate Kappa calculations for fair token distribution.
Users and external contracts interact with the DistributionModule expecting correct token allocations.
Attack Path
An attacker or user observes the incorrect scaling in the _calculateKappa function.
They exploit the inflated Kappa value by interacting with the DistributionModule to receive disproportionately higher token allocations.
The attacker benefits from the inflated token distribution, potentially draining the system of resources or disrupting its protocol economic balance.
Impact
Economic Disruption: Incorrect Kappa values lead to unfair token distribution, potentially disadvantaging legitimate users.
Financial Loss: The protocol would suffer financial losses due to inflated token allocations.
Loss of Trust: Users would lose confidence in the protocol's fairness and reliability.
PoC
The issue is evident in the following code snippet:
Here, BPS_SCALAR is defined as 10^4, but the comment indicates that the scaling should be 10^5. This mismatch results in a denominator that is 10 times smaller than intended, inflating the Kappa value by a factor of 10.
Mitigation
Protocol should update the denominator calculation to use the correct scaling factor of 10^5 instead of 10^4 as noted in comment description.
The text was updated successfully, but these errors were encountered: