The function above shows how Received signals are proven by the _proveSignalReceived(...) function, it can be noted that the second parameter takes in the signal to be proven. A look at the code below also shows where this function is called as noted in the pointer, it can be noted that the hashed Message was converted to signal before it was proved with the _proveSignalReceived(...) function.
function proveMessageFailed(
Message calldata _message,
bytes calldata _proof
)
public
view
returns (bool)
{
if (_message.srcChainId != block.chainid) return false;
return _proveSignalReceived(
resolve("signal_service", false),
>>> signalForFailedMessage(hashMessage(_message)),
_message.destChainId,
_proof
);
}
The problem is in the code below in other instance where this signal prove function was called, instead of converting the hashMessage to a provable signal, the hash message was used directly which would means proving an invalid signal
function proveMessageReceived(
Message calldata _message,
bytes calldata _proof
)
public
view
returns (bool)
{
if (_message.destChainId != block.chainid) return false;
return _proveSignalReceived(
>>> resolve("signal_service", false), hashMessage(_message), _message.srcChainId, _proof
);
}
Tools Used
Manual Reveiw
Recommended Mitigation Steps
The protocol should make necessary adjustment to ensure the hashMessage is first converted to a provable signal to avoid Denial of service or loss of fund from Wrong Signal
Lines of code
https://github.com/code-423n4/2024-03-taiko/blob/main/packages/protocol/contracts/bridge/Bridge.sol#L384 https://github.com/code-423n4/2024-03-taiko/blob/main/packages/protocol/contracts/bridge/Bridge.sol#L364 https://github.com/code-423n4/2024-03-taiko/blob/main/packages/protocol/contracts/bridge/Bridge.sol#L579
Vulnerability details
Impact
Invalid Signal used to Prove Signal Received in the Bridge contract
Proof of Concept
The function above shows how Received signals are proven by the _proveSignalReceived(...) function, it can be noted that the second parameter takes in the signal to be proven. A look at the code below also shows where this function is called as noted in the pointer, it can be noted that the hashed Message was converted to signal before it was proved with the _proveSignalReceived(...) function.
The problem is in the code below in other instance where this signal prove function was called, instead of converting the hashMessage to a provable signal, the hash message was used directly which would means proving an invalid signal
Tools Used
Manual Reveiw
Recommended Mitigation Steps
The protocol should make necessary adjustment to ensure the hashMessage is first converted to a provable signal to avoid Denial of service or loss of fund from Wrong Signal
Assessed type
en/de-code