A malicious user having just 1 DAI can process millions of transactions and call ZivoeITO::depositSenior millions of times by depositing only 1 wei of DAI. These transaction will be processed and considered legit by the code.
Impact
This vulnerability has various impacts. Due to a large number of malicious transactions, there could be network congestion and block gas limit exhaustion resulting into Denial of Service for other legit ZivoeITO::depositSenior transactions.
Another impact is that ZivoeITO::depositJunior will keep reverting because ZivoeITO::isJuniorOpen will return false because seniorSupp will be very much lower and convertedAmount will most probably always be higher than seniorSupp * 2000 / BIPS. This will also result into a Denial of Service for users trying to deposit in Junior Tranche.
Ran 1 test for src/TESTS_Core/Test_ZivoeITO.sol:Test_ZivoeITO
[PASS] test_WY_ZivoeITO_depositSenior_oneWei() (gas: 184711)
Logs:
Senior credits 3
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 4.86ms (267.13µs CPU time)
Ran 1 test suite in 125.36ms (4.86ms CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests)
Tool used
Manual Review
Recommendation
In ZivoeITO::depositSenior and ZivoeITO::depositJunior, a restriction should be implemented for minimum amount to be deposited in a transaction.
0xe4669da
medium
ZivoeITO::depositSenior
allows 1wei
to be deposited and this could lead to Denial of Service attackSummary
ZivoeITO::depositSenior
allows depositing only 1wei
.Vulnerability Detail
Source: First Impact
Source: Second Impact
A malicious user having just 1
DAI
can process millions of transactions and callZivoeITO::depositSenior
millions of times by depositing only 1wei
ofDAI
. These transaction will be processed and considered legit by the code.Impact
This vulnerability has various impacts. Due to a large number of malicious transactions, there could be network congestion and block gas limit exhaustion resulting into Denial of Service for other legit
ZivoeITO::depositSenior
transactions.Another impact is that
ZivoeITO::depositJunior
will keep reverting becauseZivoeITO::isJuniorOpen
will return false becauseseniorSupp
will be very much lower andconvertedAmount
will most probably always be higher thanseniorSupp * 2000 / BIPS
. This will also result into a Denial of Service for users trying to deposit in Junior Tranche.Code Snippet
Add below test in
Test_ZivoeITO.sol
Tool used
Manual Review
Recommendation
In
ZivoeITO::depositSenior
andZivoeITO::depositJunior
, a restriction should be implemented for minimum amount to be deposited in a transaction.