Submitted by WatchPug, also found by cmichel
https://github.com/skalenetwork/ima-c4-audit/blob/11d6a6ae5bf16af552edd75183791375e501915f/contracts/MessageProxy.sol#L313-L317
https://github.com/skalenetwork/ima-c4-audit/blob/11d6a6ae5bf16af552edd75183791375e501915f/contracts/MessageProxy.sol#L402-L409
In the current implementation, when a connected chain is removed, the incomingMessageCounter and outgoingMessageCounter will be deleted.
And if its reconnected again, the incomingMessageCounter and outgoingMessageCounter will be reset to 0.
However, since the contract is using connectedChains[fromChainHash].incomingMessageCounter and signature to ensure that the message can only be processed once.
https://github.com/skalenetwork/ima-c4-audit/blob/11d6a6ae5bf16af552edd75183791375e501915f/contracts/schain/MessageProxyForSchain.sol#L212-L221
When removing and connecting a schain, instead of delete/reset the couter, consider leaving the counter as it is when removeConnectedChain, _addConnectedChain also should not reset the counter:
DimaStebaev (SKALE) disagreed with severity and commented:
GalloDaSballo (judge) decreased severity to Medium and commented:
