The chop
function in the UnripeFacet
contract lacks proper access control, allowing any user or contract to call it with potentially harmful parameters. This lack of access control opens up the possibility for malicious actors to manipulate the token burning process, compromising the integrity of the system.
The vulnerability in the chop
function of the UnripeFacet
contract stems from the lack of access control, allowing any user or contract to manipulate the token burning process. Let's delve into the details to understand how this vulnerability arises and its potential impact:
The chop
function is designed to convert Unripe Tokens into Ripe Tokens according to a specific conversion rate. It is a critical part of the system's functionality, allowing users to exchange Unripe Tokens for their underlying assets.
Within the chop
function, there is a dependency on the burnToken
function to burn Unripe Tokens. The burnToken
function handles the burning process based on the value of the mode parameter passed to it.
The mode
parameter determines the behavior of the burnToken
function. If mode
is set to EXTERNAL
, it directly calls the burnFrom
function on the Unripe Token contract, burning tokens from the sender's balance. Otherwise, it calls the receiveToken
function , receives tokens, and then burns the received amount.
The vulnerability arises because the chop
function is marked as public, meaning it can be accessed by any user or contract in the system without restriction. Malicious actors can exploit this unrestricted access to manipulate the mode
parameter and control the token burning process.
By calling the chop
function with a custom mode
parameter value, malicious actors can bypass the intended burn mechanism. They can control the amount of tokens received before burning, potentially leading to a loss of token value, disruption in system operations, or other adverse effects.
The lack of access control in the chop
function poses a severe risk to the system's integrity and security. Unauthorized manipulation of the token burning process can result in financial losses for users, undermine trust in the platform, and disrupt system operations.
Manual
Add permission checks or access modifiers to ensure that only trusted entities can call the chop
function with the correct parameters.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.