Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: medium
Invalid

Missing non reentrancy modifier in `FeeDistributionBranch::receiveMarketFee`

Vulnerability Details

The function receiveMarketFee in FeeDistributionBranch contract call IERC20(asset).safeTransferFrom(msg.sender, address(this), amount) to transfer tokens from the caller to the contract which makes it vulnerable to reentrancy attacks.
After the external call, the function updates the state by calling market.depositFee(asset, amountX18) or _handleWethRewardDistribution(market, address(0), amountX18). If a reentrancy attack occurs, the attacker could manipulate the state or exploit the function multiple times before the state changes are applied

Impact

An attacker could call the function multiple times before the state is updated, effectively receiving fees or rewards multiple times for a single transaction.

Recommendations

It is always advisable to use openzeppelin reentrancy guard modifier to avoid or prevent reentrancy error when dealing with a contract that involves external call to another contract and since _handleWethRewardDistribution requires assets to be in the contract.

Updates

Lead Judging Commences

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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

Give us feedback!