Peers that have been set cannot be modified or deleted.
Summary
A target chain corresponds to a Peer account, which stores the target chain address for cross-chain message sending. However, the program does not provide any method to modify the target chain message sending address, nor can it delete any unsupported target chains.
Root Cause
The administrator can only initialize a Peer account for a target chain once, and the program lacks the functionality to modify or delete an already enabled Peer.
The target chain contract address needs to be migrated for various reasons.
Attack Path
None
Impact
The administrator cannot adjust the target chain address of the Peer account, and when the target chain is no longer in use, the Peer address cannot be deleted to prevent users from sending cross-chain messages.
PoC
No response
Mitigation
It is recommended to allow the administrator to reset the target chain address, while also adding an "allowed" parameter to the Peer account to enable and disable cross-chain messages for the target chain
shaflow01
Medium
Peers that have been set cannot be modified or deleted.
Summary
A target chain corresponds to a Peer account, which stores the target chain address for cross-chain message sending. However, the program does not provide any method to modify the target chain message sending address, nor can it delete any unsupported target chains.
Root Cause
The administrator can only initialize a Peer account for a target chain once, and the program lacks the functionality to modify or delete an already enabled Peer.
https://github.com/sherlock-audit/2024-09-orderly-network-solana-contract/blob/02396b61f6e77008d8d24c8b84f65644b20f445e/solana-vault/packages/solana/contracts/programs/solana-vault/src/instructions/oapp_instr/set_peer.rs#L12
Internal pre-conditions
None
External pre-conditions
The target chain contract address needs to be migrated for various reasons.
Attack Path
None
Impact
The administrator cannot adjust the target chain address of the Peer account, and when the target chain is no longer in use, the Peer address cannot be deleted to prevent users from sending cross-chain messages.
PoC
No response
Mitigation
It is recommended to allow the administrator to reset the target chain address, while also adding an "allowed" parameter to the Peer account to enable and disable cross-chain messages for the target chain