Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 936 Bytes

File metadata and controls

26 lines (20 loc) · 936 Bytes

Festive Flaxen Raccoon

Medium

no check the return value of _computeCreate2Address.

Summary

The function does not revert properly if there is a failed contract deployment or revert from the create2 opcode as it does not properly check the returned address for bytecode. The create2 opcode returns the expected address which willbe the zero address .

Vulnerability Detail

function _computeCreate2Address(bytes memory data, bytes32 salt) internal view returns (address) { bytes memory bytecode = abi.encodePacked( type(BeaconProxy).creationCode, abi.encode(address(this), data) ); @> return Create2.computeAddress(salt, keccak256(bytecode)); }

Impact

Code Snippet

https://github.com/sherlock-audit/2024-08-perennial-v2-update-3/blob/main/root/contracts/attribute/Factory.sol#L58

Tool used

Manual Review

Recommendation

check the result of Create2.computeAddress.