Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Latest commit

 

History

History
38 lines (29 loc) · 992 Bytes

160.md

File metadata and controls

38 lines (29 loc) · 992 Bytes

bin2chen

medium

_validateSigner() cross-chain re-use signature risk

Summary

_validateSigner() not add chainId to signature have re-use signature risk if There is a need for subsequent deployment in other chains.

Vulnerability Detail

_validateSigner() without chainId

    function _validateSigner(
        uint256 timestamp,
        address asset,
        uint256 price,
        bytes memory signature
    ) internal view returns (bool) {
        bytes32 digest = ECDSA.toEthSignedMessageHash(
            keccak256(abi.encodePacked(timestamp, asset, price)) //***@audit without chainId***/
        );
        address recoveredSigner = ECDSA.recover(digest, signature);
        return recoveredSigner == publisher;
    }

Impact

cross-chain re-use signature risk

Code Snippet

https://github.com/sherlock-audit/2022-11-buffer/blob/main/contracts/contracts/core/BufferRouter.sol#L260-L271

Tool used

Manual Review

Recommendation

signature with chainid