Hermes: Make sure hermes cannot be slowed down by packets to fake chains #1038
Closed
Description
If I'm not mistaken, when Hermes catches an IBC transfer to relay, it does the following:
- Figure out source channel
- Using source channel, query the source chain to get the counterparty's chain-id
- Create packets and submit them to counterparty chain
The (potential) issue is that chain-ids are not unique, meaning it is possible for someone to create an IBC connection with a chain-id that is exactly the same as the chain-id of a "real chain". This could potentially be a problem is hermes retries multiple times if header verification fails. Consider the following scenario:
- An IBC connection between Cosmos Hub and Akash is open. On Cosmos Hub, the client ID of Akash is
client-1
and the chain-id isakash-1
. - An attacker creates a fake Akash chain using starport and opens an IBC connection with the Hub. The attacker uses the same chain-id
akash-1
, only the client-id is different,client-2
. - The attacker then sends a bunch of IBC transfers from Cosmos Hub to the fake Akash chain.
- Hermes picks up the packets. It reads the counterparty chain-id for the channel, which gives
akash-1
. - Hermes then tries to relay the packet to the real Akash chain, but the relaying fails during header verification. Hermes then retries (how many times?).
My questions is: do we have a problem? Can this slow down Hermes significantly?