DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: medium
Invalid

Missing zero check address onlyValidAsset

Summary

Missing zero address check

Vulnerability Details

The modifier, onlyValidAsset, confirms if the asset's vault is zero. However, it does not validate whether the asset address is a zero address.

Impact

Tools Used

Manual view

Recommendations

To resolve this issue, you should add an additional check in the onlyValidAsset modifiers to ensure that the asset and bridge addresses are not zero addresses. Here is how you can modify the code:

modifier onlyValidAsset(address asset) {
require(asset != address(0), "Asset address cannot be 0");
if (s.asset[asset].vault == 0) revert Errors.InvalidAsset();
_;
}

The require statement will ensure that the provided address is not a zero address. If it is, it will revert the transaction and provide a descriptive error message. This will prevent any potential issues or vulnerabilities related to zero addresses.

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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