code-423n4 / 2023-04-ens-findings

0 stars 0 forks source link

Upgraded Q -> 2 from #49 [1683711003164] #332

Closed c4-judge closed 1 year ago

c4-judge commented 1 year ago

Judge has assessed an item in Issue #49 as 2 risk. The relevant finding follows:

QA9. hexStringToBytes32() fails to check that range [idx, lastIdx] is within 32 bytes range and thus the returned r will fit into bytes32.

https://github.com/code-423n4/2023-04-ens/blob/45ea10bacb2a398e14d711fe28d1738271cd7640/contracts/utils/HexUtils.sol#L11-L60

Mitigation: Introduce the check:

function hexStringToBytes32( bytes memory str, uint256 idx, uint256 lastIdx ) internal pure returns (bytes32 r, bool valid) {

c4-judge commented 1 year ago

dmvt marked the issue as duplicate of #281

c4-judge commented 1 year ago

dmvt marked the issue as partial-50