Submitted by berndartmueller, also found by kuprum and p0wd3r
The MsgUpdateObserver message, handled in the UpdateObserver function, allows the admin or an (tombstoned) observer to update the observer address.
Internally, in line 36, the UpdateObserverAddress function is called to update the observer address in the ObserverMapper for each chain.
However, a tombstoned observer is able to maliciously add a duplicate observer to the list by specifying an observer address (NewObserverAddress) in the MsgUpdateObserver message that is already in the ObserverList list.
As a result, the ObserverList list contains duplicates.
For the specific impact, please refer to the Impact section.
The following test case demonstrates how the tombstoned validator can add a duplicate observer address:
Please note that an admin can also accidentally add duplicate observers, node/x/observer/keeper/msgserveradd_observer.go#L47
Consider checking in the UpdateObserverAddress function if the newObserverAddress is already in the list and return an error if it is.
lumtis (ZetaChain) confirmed
