DeFiHardhat
21,000 USDC
View results
Submission Details
Severity: low
Invalid

Reentrancy Guard Missing

Summary

The audit identified a missing reentrancy guard in the switchUnderlyingToken function within the UnripeFacet contract.

Vulnerability Detail

The UnripeFacet::switchUnderlyingToken function lacks a reentrancy guard, leaving it vulnerable to reentrancy attacks.

Impact

Without a reentrancy guard, an attacker could potentially exploit the function to execute malicious code multiple times within a single transaction, leading to unexpected behaviour and potential loss of funds.

Code Snippet

function switchUnderlyingToken(
address unripeToken,
address newUnderlyingToken
) external payable {
LibDiamond.enforceIsContractOwner();
require(s.u[unripeToken].balanceOfUnderlying == 0, "Unripe: Underlying balance > 0");
LibUnripe.switchUnderlyingToken(unripeToken, newUnderlyingToken);
}

Tool used

Manual Review

Recommendation

Implement a reentrancy guard within the UnripeFacet::switchUnderlyingToken function to prevent potential reentrancy attacks.

Updates

Lead Judging Commences

giovannidisiena Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.