Part 2

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

Unrestricted approvals in FeeDistributionBranch.sol::_performMultiDexSwap()

Summary

The function _performMultiDexSwap(...) repeatedly approves tokens without resetting allowances, which could lead to potential misuse by a malicious or compromised DEX adapter.

Vulnerability Details

  • The function approves tokens for DEX adapters without resetting these allowances afterward.

  • A malicious adapter could potentially move more funds than intended if it is untrusted or if there is a bug allowing calls under different parameters.

javascript

IERC20(assets[i]).approve(dexSwapStrategy.dexAdapter, amountIn);
...
amountIn = dexSwapStrategy.executeSwapExactInputSingle(swapCallData);

Impact

If an adapter is compromised or untrusted, it could exploit the unrestricted approvals to transfer more tokens than intended. This could result in unauthorized token drains.

Tools Used

Manual code review

Recommendations

  • Implement a mechanism to reset token allowances after swaps.

  • Ensure that only trusted DEX adapters are used.

Updates

Lead Judging Commences

inallhonesty Lead Judge
7 months ago
inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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