Loss of pending messages (if any) in case removeConnectedChain is called
The removeConnectedChain function deletes a chain's configuration without checking for pending messages, so any unprocessed messages (including token transfers) may become stuck or lost. An attacker with admin privileges could use this to deny operations.
Submitted by hubble
If there are any unprocessed messages to be executed or processed, while removeConnectedChain is called, then they may be stuck from getting processed on the other end. If these messages have transactions for any token transfer then it will get stuck or lost.
Proof of Concept
Contract : MessageProxy.sol Line : 313
function removeConnectedChain(string memory schainName) public virtual override onlyChainConnector {
bytes32 schainHash = keccak256(abi.encodePacked(schainName));
require(connectedChains[schainHash].inited, "Chain is not initialized");
delete connectedChains[schainHash];
}
Recommended Mitigation Steps
Check if there are any pending or unprocessed messages while removeConnectedChain is called and revert in that case. Better to implement some functionality like pause just locally for the chain to be removed, before the actual removeConnectedChain is called.
DimaStebaev (SKALE) commented:
It duplicates #57
GalloDaSballo (judge) commented:
I don’t believe this to be a duplicate.
I think the finding is valid in that because of the synchronicity of broadcasting messages, the chain could be removed before it receives all messages.
This is a risk that end users do face when interacting with the system and the only use case I could think of would be for a malicious admin to deny certain operations.
That said I don’t believe there’s any easy solution as this would have to be addressed at the meta level.
I do think the finding is valid and of medium severity
cstrangedk (SKALE) commented: Issue is acknowledged and work is pending on the roadmap to prevent improper use of removeConnectedChain.
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
Likely the removeConnectedChain function lacks a check for pending or unprocessed messages before deleting the chain's configuration.
Impact
Pending messages, including token transfers, may be stuck or lost, and a malicious admin could deny certain operations.
What the attacker needed
Admin privileges to call removeConnectedChain; pending messages exist
The fix
The report recommends checking for pending messages and reverting if any exist, or implementing a local pause before removal; the project acknowledges the issue and work is pending.
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.
This is a smart contract that connects different blockchains. When an admin removes a chain, the code simply deletes its settings. If messages are still waiting to be delivered, they get lost. An admin could abuse this to block transfers.
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.