Submitted by 0xsomeone
contracts/lib/ConsiderationEncoder.sol#L569-L574
The order hashes are incorrectly encoded during the _encodeOrderHashes mechanism, causing functions such as _encodeRatifyOrder and _encodeValidateOrder to misbehave.
The order hashes encoding mechanism appears to be incorrect as the instructions srcLength.next().offset(headAndTailSize) will cause the pointer to move to the end of the array (i.e. next() skips the arrays length bitwise entry and offset(headAndTailSize) causes the pointer to point right after the last element). In turn, this will cause the 0x04 precompile within MemoryPointerLib::copy to handle the data incorrectly and attempt to copy data from the srcLength.next().offset(headAndTailSize) pointer onwards which will be un-allocated space and thus lead to incorrect bytes being copied.
Manual inspection of the codebase, documentation of the ETH precompiles, and the Solidity compiler documentation.
We advise the offset instruction to be omitted as the current implementation will copy from unsafe memory space, causing data corruption in the worst-case scenario and incorrect order hashes being specified in the encoded payload. As an additional point, the _encodeOrderHashes will fail execution if the array of order hashes is empty as a headAndTailSize of 0 will cause the MemoryPointerLib::copy function to fail as the precompile would yield a returndatasize() of 0.
0age (OpenSea) confirmed, but disagreed with severity and commented:
hickuphh3 (judge) decreased severity to Medium and commented:
For this contest, 17 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by horsefacts received the top score from the judge.
The following wardens also submitted reports: delfin454000, Josiah, Chom, charlesjhongc, nadin, IllIllI, 0xSmartContract, csanuragjain, brgltd, chaduke, RaymondFam, Rolezn, Rickard, ABA, btk, and oyc_109.
