Suspended bridge transactions cannot be restored
The restoreBridgeTransaction function requires the invalidBridgedAmountsPool address to be non-zero, but no setter exists to set it, so it is always zero and the function always reverts. As a result, suspended bridge transactions cannot be restored, assets remain stuck, and bridge service providers cannot reclaim transferred assets.
slowfi Follow with xiaoming90
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2024-06-symmetrical-update-2-judging/issues/9
Found by
slowfi, xiaoming90
Summary
Suspended bridge transactions cannot be restored. As a result, the assets will be stuck, and bridge service providers cannot reclaim the assets they have transferred to the users from the protocol.
Vulnerability Detail
In Line 90 below, when restoring the bridge transaction, the invalid assets will be deposited into the account of bridgeLayout.invalidBridgedAmountsPool. These invalid assets can be withdrawn from this account/pool at a later time.
Per Line 88 below, if the bridgeLayout.invalidBridgedAmountsPool is zero, the restoreBridgeTransaction transaction will revert.
However, within the codebase, there is no way to update the bridgeLayout.invalidBridgedAmountsPool value. Thus, the bridgeLayout.invalidBridgedAmountsPool will always be zero. The restoreBridgeTransaction transaction will always revert and there is no way to restore a suspended bridge transaction. As a result, the assets will be stuck, and bridge service providers will not be able to reclaim the assets they have transferred to the users from the protocol.
File: BridgeFacetImpl.sol
83: function restoreBridgeTransaction(uint256 transactionId, uint256 validAmount) internal {
84: BridgeStorage.Layout storage bridgeLayout = BridgeStorage.layout();
85: BridgeTransaction storage bridgeTransaction = bridgeLayout.bridgeTransactions[transactionId];
86:
87: require(bridgeTransaction.status == BridgeTransactionStatus.SUSPENDED, "BridgeFacet: Invalid status");
88: require(bridgeLayout.invalidBridgedAmountsPool != address(0), "BridgeFacet: Zero address");
89:
90: AccountStorage.layout().balances[bridgeLayout.invalidBridgedAmountsPool] += (bridgeTransaction.amount - validAmount);
91: bridgeTransaction.status = BridgeTransactionStatus.RECEIVED;
92: bridgeTransaction.amount = validAmount;
93: }
Impact
Loss of assets. The assets will be stuck, and bridge service providers cannot reclaim the assets they have transferred to the users from the protocol.
Code Snippet
Tool used
Manual Review
Recommendation
Implement a setter function for the invalidBridgedAmountsPool variable.
+ function updateInvalidBridgedAmountsPool(address poolAddress) external onlyRole(LibAccessibility.DEFAULT_ADMIN_ROLE) {
+ BridgeStorage.layout().invalidBridgedAmountsPool = poolAddress;
+ }
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/SYMM-IO/protocol-core/pull/46
sherlock-admin2
The Lead Senior Watson signed off on the fix.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The contract requires a non-zero invalidBridgedAmountsPool address but provides no way to set it, so the requirement can never be satisfied.
Impact
Assets from suspended bridge transactions become stuck and bridge service providers cannot reclaim assets they transferred to users.
What the attacker needed
A bridge transaction becomes suspended
The fix
The protocol team fixed this issue by adding a setter function for the invalidBridgedAmountsPool variable.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A bridge moves assets between networks. If a bridge transaction is suspended, an admin should be able to restore it by marking some amount as invalid and sending it to a special pool. But the code requires that pool's address to be set, and there is no function to set it, so the restore always fails and the assets stay stuck.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.