Open c4-bot-10 opened 10 months ago
alex-ppg marked the issue as primary issue
alex-ppg marked the issue as insufficient quality report
dmvt marked the issue as unsatisfactory: Out of scope
hey @dmvt this issue has nothing similar to the linked list of vulnerabilities and nothing is talking about it in that list. pls, check the issue again or specify where such behavior is described in the known vulnerabilities.
thanks
I agree with the warden above, I failed to find a vulnerability that exactly matches the finding described here. Maybe it was mistaken with N2 - depositServiceDonationsETH function (OLAS incentives)
, which describes how a service owner can get a significant portion of the reward by donating to his services in the early stages of the protocol lifetime.
Unlike N2, this report addresses an issue that allows creating multiple components and agents to manipulate the IDF value and as a result increase OLAS received in exchange for LP tokens.
Apologies. I think I hit the wrong macro on this. I meant to mark this as invalid due to centralization risk. The registry is admin controlled and new owners cannot be introduced without admin collusion. https://docs.code4rena.com/awarding/judging-criteria/supreme-court-decisions-fall-2023#verdict-severity-standardization-centralization-risks
But anyone can create component. There is no approve from admins.
I will vet this one again later tonight. Even though PJQA is now closed, I've indicated to the C4 team that they should hold off on finalizing the contest until I have time to thoroughly review this issue again.
@rvierdiyev @k4zanmalay hey guys, agree that the issue in the vulnerability is not the same. However, setting up a test based on a mock contract is not something that might prove the point.
First consideration is creating components and agents on L1 at such an amount is super expensive.
Second, the IDF is bound by the maximum of 1 + epsilonRate
, where epsilonRate = 1e17
. Clearly, if the governance changes epsilonRate
to the max possible 17e18
, the IDF
can take some mind blowing values, but that is not going to be the case as the protocol is not enemy to itself. But to make an attack like that, the DAO is the attacker, however it's not in the protocol scope to consider that as the epsilonRate
will be one of the last concerns at that point.
While I think this is highly unlikely, I'm going to give the warden the benefit of downgrading to QA.
Mistakes in code only unblocked through admin mistakes are QA-level
dmvt changed the severity to QA (Quality Assurance)
dmvt marked the issue as grade-c
dmvt marked the issue as grade-b
Lines of code
https://github.com/code-423n4/2023-12-autonolas/blob/main/tokenomics/contracts/Tokenomics.sol#L831-L862 https://github.com/code-423n4/2023-12-autonolas/blob/main/tokenomics/contracts/Tokenomics.sol#L765-L770
Vulnerability details
Impact
IDF value can be manipulated to get more OLAS for the LP tokens.
Proof of Concept
Every epoch IDF value is calculated based on treasury rewards, and number of the new components.
https://github.com/code-423n4/2023-12-autonolas/blob/main/tokenomics/contracts/Tokenomics.sol#L1041-L1045
This value is then used to calculate amount of OLAS tokens in exchange for the LP tokens
https://github.com/code-423n4/2023-12-autonolas/blob/main/tokenomics/contracts/GenericBondCalculator.sol#L64
Formula for IDF is
By manipulating newOwners value we can greatly increase IDF:
Here is the case for
Dispencer.js
I modified a MockRegistry to simulate multiple components with different owners
As we can see donating to 100 components gives us
2000065000000000000
which will double the amount of OLAS tokens for the given LP amount compared to the default IDF value of 1e18.Tools Used
Hardhat
Recommended Mitigation Steps
The minimal donation amount check for each component/agent can make this sort of attack economically unfeasible https://github.com/code-423n4/2023-12-autonolas/blob/main/tokenomics/contracts/Tokenomics.sol#L726
Assessed type
Other