This repository has been archived by the owner on Jul 14, 2024. It is now read-only.
XDZIBEC - Reentrancy Vulnerability in EIP-2535 Diamond Standard Implementation #119
Labels
Excluded
Excluded by the judge without consulting the protocol or the senior
Non-Reward
This issue will not receive a payout
Sponsor Disputed
The sponsor disputed this issue's validity
Won't Fix
The sponsor confirmed this issue will not be fixed
XDZIBEC
high
Reentrancy Vulnerability in EIP-2535 Diamond Standard Implementation
Summary
The contract is Standard allows for modular contract development using the "facet" pattern, which can lead to complex interactions between different parts of the contract and it's contain a reentrancy vulnerability from the missing of the
nonReentrant
modifier.Vulnerability Detail
The contract use fallback function and employs delegatecall to forward external calls to addresses determined by the
selectorToFacetAndPosition
mapping and this setup presents a risk of reentrancy attacks, because the contract itself does not have a reentrancy guard. This means each facet, especially those with state-changing and payable functions, must independently implement reentrancy protection measures. If these facets lack appropriate guards, they can be vulnerable to reentrancy attacks. In such attacks, an adversary could exploit the absence of reentrancy protection to perform unexpected state changes or asset transfers by recursively calling the function.here is the vulnerable part :
An attacker can potentially leverage this vulnerability to manipulate contract states or extract funds,
Impact
Without reentrancy guards, an attacker could potentially exploit this vulnerability and manipulate the contract's state and then can drain funds.
This is especially risk for state-changing and payable functions within the facets.
Code Snippet
Tool used
Manual Review
Recommendation
need to add the nonReentrant modifier on the fallback function.
The text was updated successfully, but these errors were encountered: