code-423n4 / 2023-01-drips-findings

0 stars 2 forks source link

Incorrect shift in assembly #323

Closed code423n4 closed 1 year ago

code423n4 commented 1 year ago

Lines of code

https://github.com/code-423n4/2023-01-drips/blob/main/src/Drips.sol#L823

Vulnerability details

Impact

Shift operators (shl(x, y), shr(x, y), sar(x, y)) in Solidity assembly apply the shift operation of x bits on y and not the other way around, which may be confusing. Check if the values in a shift operation are reversed.

Proof of Concept

File: Drips.sol

823:             val := mload(add(32, add(configs, shl(5, idx))))

Tools Used

VS Code

Recommended Mitigation Steps

Swap the order of parameters.

GalloDaSballo commented 1 year ago

Missing proof, this doesn't meet the basics for a High Severity report, please always add a POC to your reports no matter how trivial they may look to you

c4-judge commented 1 year ago

GalloDaSballo marked the issue as unsatisfactory: Insufficient proof