Open c4-bot-1 opened 7 months ago
minhquanym marked the issue as primary issue
Insufficient proof
dantaik (sponsor) confirmed
This PR mitigates the concerns in this issue , but I'm having a hard time to construct an exploiting transaction with a bridge loop that has actual security impact.
0xean marked the issue as satisfactory
0xean marked the issue as selected for report
Welcome more comment from wardens and sponsors here during PJQA but perhaps this is better as QA since there is not enough proof to show the attack.
Hi @0xean, I believe this issue should be of QA-severity.
I do not see a security risk entailed on how this could be misused or could impact the protocol. Additionally, I agree with the sponsor's comment on the fix regarding this issue: https://github.com/taikoxyz/taiko-mono/pull/16659#issuecomment-2039252060
Please consider re-evaluating this issue.
Thank you!
After thinking about this more, marking down to QA, as I just don't think there is a sufficient proof to warrant M
0xean changed the severity to QA (Quality Assurance)
0xean marked the issue as grade-b
0xean marked the issue as not selected for report
Lines of code
https://github.com/code-423n4/2024-03-taiko/blob/f58384f44dbf4c6535264a472322322705133b11/packages/protocol/contracts/signal/SignalService.sol#L104-L118
Vulnerability details
Description
proveSignalReceived
function in theSignalService
contract is vulnerable to self-referential hops, allowing a malicious user to potentially manipulate the multi-hop bridging process and exploit vulnerabilities in the underlying bridge contracts.proveSignalReceived
function is responsible for verifying the inclusion of a signal in the source chain's state during the multi-hop bridging process._chainId
: The ID of the chain where the signal originates._app
: The address of the application contract._signal
: The signal being verified._proof
: The merkle proof for the signal's inclusion in the source chain's state.HopProof
array, verifying each hop using the_verifyHopProof
function.Vulnerability Details
proveSignalReceived
function.File: SignalService.sol:L104-L117
This lines checks for invalid last hop and intermediate hop chain IDs but does not prevent self-referential hops.
Expected Behavior
proveSignalReceived
function should verify the inclusion of a signal in the source chain's state by iterating over the providedHopProof
array and ensuring the validity of each hop.But the current Behavior
proveSignalReceived
function allows proofs with self-referential hops to be accepted.Impact
Malicious users can construct proofs with self-referential hops to bypass the loop detection mechanism and potentially exploit vulnerabilities in the bridge contracts.
Recommended Mitigation Steps
The function should maintain a mapping or array to keep track of the visited chain IDs and ensure that each hop's chain ID is unique and has not been encountered in any previous hops.
proveSignalReceived
function can explicitly detect and prevent self-referential hops, ensuring the integrity of the multi-hop bridging process.Assessed type
Reentrancy