DittoETH

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

Missing inputAmount != 0 checks

Summary

There are some functions that do not sanitize inputs to ensure zero amounts are not passed in

Vulnerability Details

Zero value inputs in some functionality can lead to unintended or unexpected behaviours as in the links provided and or examples below ExitShortFacet.sol line 149

function exitShort(
address asset,
uint8 id,
uint88 buyBackAmount,
uint80 price,
uint16[] memory shortHintArray
)

In above function caller can mistakenly exit short with price = 0 (e.g faulty front ends may use default value uint etc); Tracking the price value and its calculations in the functions shows function will go through disadvantaging the caller.

Impact

Zero unintended amount or value inputs can lead to accounting problems, disadvantaging users or protocol not working as expected. As seen in example below it disadvantages user who exits short with 0 price. This is a low impact as users need to be careful with their inputs, however protocol needs to help by enforcing and sanitizing inputs.

Tools Used

Manual Analysis

Recommendations

Recommended to enforce that where inputs taking amount = 0 as not intended enforce that it's not possible e.g

require(amountInput != 0, "error message")
Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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