Closed sherlock-admin3 closed 6 months ago
applyCombine
valid
combinations
combineCounter
Low/Info issue submitted by saidam017
applyCombine wrongly sets the valid flag of combinations due to incorrectly clearing the valid flag of combineCounter instead of the provided id.
id
When applyCombine is called, it set combinations[combineCounter].valid to false instead of `combinations[id].valid.
combinations[combineCounter].valid
false
`combinations[id].valid
https://github.com/sherlock-audit/2024-03-zivoe/blob/main/zivoe-core-foundry/src/lockers/OCC/OCC_Modular.sol#L749
function applyCombine(uint256 id) external { require(combinations[id].valid, "OCC_Modular::applyCombine() !combinations[id].valid"); require( block.timestamp < combinations[id].expires, "OCC_Modular::applyCombine() block.timestamp >= combinations[id].expires" ); >>> combinations[combineCounter].valid = false; // .... }
Low, as the id still can't be combined twice because the loan's state is no longer LoanState.Active, and it will not impact combinations at combineCounter because it does not yet exist.
LoanState.Active
Manual Review
set combinations[id].valid to false instead.
combinations[id].valid
Valid
applyCombine
incorrectly sets thevalid
flag ofcombinations
atcombineCounter
Low/Info issue submitted by saidam017
Summary
applyCombine
wrongly sets the valid flag of combinations due to incorrectly clearing the valid flag ofcombineCounter
instead of the providedid
.Vulnerability Detail
When
applyCombine
is called, it setcombinations[combineCounter].valid
tofalse
instead of`combinations[id].valid
.https://github.com/sherlock-audit/2024-03-zivoe/blob/main/zivoe-core-foundry/src/lockers/OCC/OCC_Modular.sol#L749
Impact
Low, as the
id
still can't be combined twice because the loan's state is no longerLoanState.Active
, and it will not impact combinations atcombineCounter
because it does not yet exist.Code Snippet
https://github.com/sherlock-audit/2024-03-zivoe/blob/main/zivoe-core-foundry/src/lockers/OCC/OCC_Modular.sol#L749
Tool used
Manual Review
Recommendation
set
combinations[id].valid
tofalse
instead.