Part 2

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

Incorrect Use of msg.sender - ZipVault.sol

Summary

The updateAssetAllowance function uses msg.sender directly to call the approve function of the asset token contract.

Vulnerability Details

The updateAssetAllowance function uses msg.sender directly to call the approve function of the asset token contract. This could potentially allow a malicious user to call the updateAssetAllowance function and approve the asset token for their own address, rather than the MarketMakingEngine contract.

Impact

High. A malicious user could approve the asset token for their own address, potentially leading to unauthorized access and misuse of the asset token.

Tools Used

Manual code review and analysis.

Recommendations

Use the marketMakingEngine address stored in the ZlpVaultStorage struct to call the approve function, rather than msg.sender.

function updateAssetAllowance(uint256 amount) external onlyMarketMakingEngine {
ZlpVaultStorage storage zlpVaultStorage = _getZlpVaultStorage();
IERC20(asset()).approve(zlpVaultStorage.marketMakingEngine, amount);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge
6 months ago
inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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