CVE-2023-35163: Improper Input Validation (CWE-20)
value: Vega is a decentralized trading platform that allows pseudo-anonymous trading of derivatives on a blockchain. Prior to version 0.71.6, a vulnerability exists that allows a malicious validator to trick the Vega network into re-processing past Ethereum events from Vega’s Ethereum bridge. For example, a deposit to the collateral bridge for 100USDT that credits a party’s general account on Vega, can be re-processed 50 times resulting in 5000USDT in that party’s general account. This is without depositing any more than the original 100USDT on the bridge. Despite this exploit requiring access to a validator's Vega key, a validator key can be obtained at the small cost of 3000VEGA, the amount needed to announce a new node onto the network.

A patch is available in version 0.71.6. No known workarounds are available, however there are mitigations in place should this vulnerability be exploited. There are monitoring alerts for `mainnet1` in place to identify any issues of this nature including this vulnerability being exploited. The validators have the ability to stop the bridge thus stopping any withdrawals should this vulnerability be exploited.
CWE description: The product receives input or data, but it does
        not validate or incorrectly validates that the input has the
        properties that are required to process the data safely and
        correctly.
CVSS v3 base score: 5.2
Published: 2023-06-23T21:15Z
Repository: https://github.com/vegaprotocol/vega
Language: Go
Files changed: core/banking/asset_action.go, core/banking/erc20.go, core/banking/mocks/mocks.go, core/bridges/erc20_logic_view.go, core/integration/stubs/bridge_view_stub.go, core/staking/on_chain_verifier.go, core/validators/erc20multisig/on_chain_verifier.go
Commit date: 2023-06-20 10:22:03 +0100
Commit message: Merge pull request from GHSA-8rc9-vxjh-qjf2

fix: on-chain verification comparison
Diff: diff --git a/core/banking/asset_action.go b/core/banking/asset_action.go
index 3eaf85b83..074ac6be9 100644
--- a/core/banking/asset_action.go
+++ b/core/banking/asset_action.go
@@ -152,33 +152,33 @@ func (t *assetAction) checkBuiltinAssetDeposit() error {
 	return nil
 }
 
 func (t *assetAction) checkERC20BridgeStopped() error {
 	return t.bridgeView.FindBridgeStopped(
-		t.erc20BridgeStopped, t.blockHeight, t.logIndex)
+		t.erc20BridgeStopped, t.blockHeight, t.logIndex, t.txHash)
 }
 
 func (t *assetAction) checkERC20BridgeResumed() error {
 	return t.bridgeView.FindBridgeResumed(
-		t.erc20BridgeResumed, t.blockHeight, t.logIndex)
+		t.erc20BridgeResumed, t.blockHeight, t.logIndex, t.txHash)
 }
 
 func (t *assetAction) checkERC20Deposit() error {
 	asset, _ := t.asset.ERC20()
 	return t.bridgeView.FindDeposit(
-		t.erc20D, t.blockHeight, t.logIndex, asset.Address(),
+		t.erc20D, t.blockHeight, t.logIndex, asset.Address(), t.txHash,
 	)
 }
 
 func (t *assetAction) checkERC20AssetList() error {
-	return t.bridgeView.FindAssetList(t.erc20AL, t.blockHeight, t.logIndex)
+	return t.bridgeView.FindAssetList(t.erc20AL, t.blockHeight, t.logIndex, t.txHash)
 }
 
 func (t *assetAction) checkERC20AssetLimitsUpdated() error {
 	asset, _ := t.asset.ERC20()
 	return t.bridgeView.FindAssetLimitsUpdated(
-		t.erc20AssetLimitsUpdated, t.blockHeight, t.logIndex, asset.Address(),
+		t.erc20AssetLimitsUpdated, t.blockHeight, t.logIndex, asset.Address(), t.txHash,
 	)
 }
 
 func (t *assetAction) getRef() snapshot.TxRef {
 	switch {
diff --git a/core/banking/erc20.go b/core/banking/erc20.go
index 7dc135326..e793a585b 100644
--- a/core/banking/erc20.go
+++ b/core/banking/erc20.go
@@ -32,15 +32,15 @@ var (
 	ErrAssetAlreadyBeingListed               = errors.New("asset already being listed")
 	ErrWithdrawalDisabledWhenBridgeIsStopped = errors.New("withdrawal issuance is disabled when the erc20 is stopped")
 )
 
 type ERC20BridgeView interface {
-	FindAssetList(al *types.ERC20AssetList, blockNumber, logIndex uint64) error
-	FindBridgeStopped(al *types.ERC20EventBridgeStopped, blockNumber, logIndex uint64) error
-	FindBridgeResumed(al *types.ERC20EventBridgeResumed, blockNumber, logIndex uint64) error
-	FindDeposit(d *types.ERC20Deposit, blockNumber, logIndex uint64, ethAssetAddress string) error
-	FindAssetLimitsUpdated(update *types.ERC20AssetLimitsUpdated, blockNumber uint64, logIndex uint64, ethAssetAddress string) error
+	FindAssetList(al *types.ERC20AssetList, blockNumber, logIndex uint64, txHash string) error
+	FindBridgeStopped(al *types.ERC20EventBridgeStopped, blockNumber, logIndex uint64, txHash string) error
+	FindBridgeResumed(al *types.ERC20EventBridgeResumed, blockNumber, logIndex uint64, txHash string) error
+	FindDeposit(d *types.ERC20Deposit, blockNumber, logIndex uint64, ethAssetAddress string, txHash string) error
+	FindAssetLimitsUpdated(update *types.ERC20AssetLimitsUpdated, blockNumber uint64, logIndex uint64, ethAssetAddress string, txHash string) error
 }
 
 func (e *Engine) EnableERC20(
 	_ context.Context,
 	al *types.ERC20AssetList,
diff --git a/core/banking/mocks/mocks.go b/core/banking/mocks/mocks.go
index dfb48105a..414314d97 100644
--- a/core/banking/mocks/mocks.go
+++ b/core/banking/mocks/mocks.go
@@ -502,77 +502,77 @@ func NewMockERC20BridgeView(ctrl *gomock.Controller) *MockERC20BridgeView {
 func (m *MockERC20BridgeView) EXPECT() *MockERC20BridgeViewMockRecorder {
 	return m.recorder
 }
 
 // FindAssetLimitsUpdated mocks base method.
-func (m *MockERC20BridgeView) FindAssetLimitsUpdated(arg0 *types.ERC20AssetLimitsUpdated, arg1, arg2 uint64, arg3 string) error {
+func (m *MockERC20BridgeView) FindAssetLimitsUpdated(arg0 *types.ERC20AssetLimitsUpdated, arg1, arg2 uint64, arg3, arg4 string) error {
 	m.ctrl.T.Helper()
-	ret := m.ctrl.Call(m, "FindAssetLimitsUpdated", arg0, arg1, arg2, arg3)
+	ret := m.ctrl.Call(m, "FindAssetLimitsUpdated", arg0, arg1, arg2, arg3, arg4)
 	ret0, _ := ret[0].(error)
 	return ret0
 }
 
 // FindAssetLimitsUpdated indicates an expected call of FindAssetLimitsUpdated.
-func (mr *MockERC20BridgeViewMockRecorder) FindAssetLimitsUpdated(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+func (mr *MockERC20BridgeViewMockRecorder) FindAssetLimitsUpdated(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
 	mr.mock.ctrl.T.Helper()
-	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindAssetLimitsUpdated", reflect.TypeOf((*MockERC20BridgeView)(nil).FindAssetLimitsUpdated), arg0, arg1, arg2, arg3)
+	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindAssetLimitsUpdated", reflect.TypeOf((*MockERC20BridgeView)(nil).FindAssetLimitsUpdated), arg0, arg1, arg2, arg3, arg4)
 }
 
 // FindAssetList mocks base method.
-func (m *MockERC20BridgeView) FindAssetList(arg0 *types.ERC20AssetList, arg1, arg2 uint64) error {
+func (m *MockERC20BridgeView) FindAssetList(arg0 *types.ERC20AssetList, arg1, arg2 uint64, arg3 string) error {
 	m.ctrl.T.Helper()
-	ret := m.ctrl.Call(m, "FindAssetList", arg0, arg1, arg2)
+	ret := m.ctrl.Call(m, "FindAssetList", arg0, arg1, arg2, arg3)
 	ret0, _ := ret[0].(error)
 	return ret0
 }
 
 // FindAssetList indicates an expected call of FindAssetList.
-func (mr *MockERC20BridgeViewMockRecorder) FindAssetList(arg0, arg1, arg2 interface{}) *gomock.Call {
+func (mr *MockERC20BridgeViewMockRecorder) FindAssetList(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
 	mr.mock.ctrl.T.Helper()
-	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindAssetList", reflect.TypeOf((*MockERC20BridgeView)(nil).FindAssetList), arg0, arg1, arg2)
+	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindAssetList", reflect.TypeOf((*MockERC20BridgeView)(nil).FindAssetList), arg0, arg1, arg2, arg3)
 }
 
 // FindBridgeResumed mocks base method.
-func (m *MockERC20BridgeView) FindBridgeResumed(arg0 *types.ERC20EventBridgeResumed, arg1, arg2 uint64) error {
+func (m *MockERC20BridgeView) FindBridgeResumed(arg0 *types.ERC20EventBridgeResumed, arg1, arg2 uint64, arg3 string) error {
 	m.ctrl.T.Helper()
-	ret := m.ctrl.Call(m, "FindBridgeResumed", arg0, arg1, arg2)
+	ret := m.ctrl.Call(m, "FindBridgeResumed", arg0, arg1, arg2, arg3)
 	ret0, _ := ret[0].(error)
 	return ret0
 }
 
 // FindBridgeResumed indicates an expected call of FindBridgeResumed.
-func (mr *MockERC20BridgeViewMockRecorder) FindBridgeResumed(arg0, arg1, arg2 interface{}) *gomock.Call {
+func (mr *MockERC20BridgeViewMockRecorder) FindBridgeResumed(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
 	mr.mock.ctrl.T.Helper()
-	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindBridgeResumed", reflect.TypeOf((*MockERC20BridgeView)(nil).FindBridgeResumed), arg0, arg1, arg2)
+	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindBridgeResumed", reflect.TypeOf((*MockERC20BridgeView)(nil).FindBridgeResumed), arg0, arg1, arg2, arg3)
 }
 
 // FindBridgeStopped mocks base method.
-func (m *MockERC20BridgeView) FindBridgeStopped(arg0 *types.ERC20EventBridgeStopped, arg1, arg2 uint64) error {
+func (m *MockERC20BridgeView) FindBridgeStopped(arg0 *types.ERC20EventBridgeStopped, arg1, arg2 uint64, arg3 string) error {
 	m.ctrl.T.Helper()
-	ret := m.ctrl.Call(m, "FindBridgeStopped", arg0, arg1, arg2)
+	ret := m.ctrl.Call(m, "FindBridgeStopped", arg0, arg1, arg2, arg3)
 	ret0, _ := ret[0].(error)
 	return ret0
 }
 
 // FindBridgeStopped indicates an expected call of FindBridgeStopped.
-func (mr *MockERC20BridgeViewMockRecorder) FindBridgeStopped(arg0, arg1, arg2 interface{}) *gomock.Call {
+func (mr *MockERC20BridgeViewMockRecorder) FindBridgeStopped(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
 	mr.mock.ctrl.T.Helper()
-	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindBridgeStopped", reflect.TypeOf((*MockERC20BridgeView)(nil).FindBridgeStopped), arg0, arg1, arg2)
+	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindBridgeStopped", reflect.TypeOf((*MockERC20BridgeView)(nil).FindBridgeStopped), arg0, arg1, arg2, arg3)
 }
 
 // FindDeposit mocks base method.
-func (m *MockERC20BridgeView) FindDeposit(arg0 *types.ERC20Deposit, arg1, arg2 uint64, arg3 string) error {
+func (m *MockERC20BridgeView) FindDeposit(arg0 *types.ERC20Deposit, arg1, arg2 uint64, arg3, arg4 string) error {
 	m.ctrl.T.Helper()
-	ret := m.ctrl.Call(m, "FindDeposit", arg0, arg1, arg2, arg3)
+	ret := m.ctrl.Call(m, "FindDeposit", arg0, arg1, arg2, arg3, arg4)
 	ret0, _ := ret[0].(error)
 	return ret0
 }
 
 // FindDeposit indicates an expected call of FindDeposit.
-func (mr *MockERC20BridgeViewMockRecorder) FindDeposit(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
+func (mr *MockERC20BridgeViewMockRecorder) FindDeposit(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
 	mr.mock.ctrl.T.Helper()
-	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindDeposit", reflect.TypeOf((*MockERC20BridgeView)(nil).FindDeposit), arg0, arg1, arg2, arg3)
+	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindDeposit", reflect.TypeOf((*MockERC20BridgeView)(nil).FindDeposit), arg0, arg1, arg2, arg3, arg4)
 }
 
 // MockEthereumEventSource is a mock of EthereumEventSource interface.
 type MockEthereumEventSource struct {
 	ctrl     *gomock.Controller
diff --git a/core/bridges/erc20_logic_view.go b/core/bridges/erc20_logic_view.go
index 0242fa359..942ab7ed2 100644
--- a/core/bridges/erc20_logic_view.go
+++ b/core/bridges/erc20_logic_view.go
@@ -109,10 +109,11 @@ func (e *ERC20LogicView) FindAsset(
 // given transaction.
 func (e *ERC20LogicView) FindAssetList(
 	al *types.ERC20AssetList,
 	blockNumber,
 	logIndex uint64,
+	txHash string,
 ) error {
 	bf, err := bridgecontract.NewErc20BridgeLogicRestrictedFilterer(
 		e.clt.CollateralBridgeAddress(), e.clt)
 	if err != nil {
 		return err
@@ -143,11 +144,12 @@ func (e *ERC20LogicView) FindAssetList(
 	assetID := strings.TrimPrefix(al.VegaAssetID, "0x")
 
 	for iter.Next() {
 		if hex.EncodeToString(iter.Event.VegaAssetId[:]) == assetID &&
 			iter.Event.Raw.BlockNumber == blockNumber &&
-			uint64(iter.Event.Raw.Index) == logIndex {
+			uint64(iter.Event.Raw.Index) == logIndex &&
+			iter.Event.Raw.TxHash.Hex() == txHash {
 			event = iter.Event
 
 			break
 		}
 	}
@@ -168,10 +170,11 @@ func (e *ERC20LogicView) FindAssetList(
 // given transaction.
 func (e *ERC20LogicView) FindBridgeStopped(
 	al *types.ERC20EventBridgeStopped,
 	blockNumber,
 	logIndex uint64,
+	txHash string,
 ) error {
 	bf, err := bridgecontract.NewErc20BridgeLogicRestrictedFilterer(
 		e.clt.CollateralBridgeAddress(), e.clt)
 	if err != nil {
 		return err
@@ -198,11 +201,12 @@ func (e *ERC20LogicView) FindBridgeStopped(
 
 	var event *bridgecontract.Erc20BridgeLogicRestrictedBridgeStopped
 
 	for iter.Next() {
 		if iter.Event.Raw.BlockNumber == blockNumber &&
-			uint64(iter.Event.Raw.Index) == logIndex {
+			uint64(iter.Event.Raw.Index) == logIndex &&
+			iter.Event.Raw.TxHash.Hex() == txHash {
 			event = iter.Event
 
 			break
 		}
 	}
@@ -223,10 +227,11 @@ func (e *ERC20LogicView) FindBridgeStopped(
 // given transaction.
 func (e *ERC20LogicView) FindBridgeResumed(
 	al *types.ERC20EventBridgeResumed,
 	blockNumber,
 	logIndex uint64,
+	txHash string,
 ) error {
 	bf, err := bridgecontract.NewErc20BridgeLogicRestrictedFilterer(
 		e.clt.CollateralBridgeAddress(), e.clt)
 	if err != nil {
 		return err
@@ -253,11 +258,12 @@ func (e *ERC20LogicView) FindBridgeResumed(
 
 	var event *bridgecontract.Erc20BridgeLogicRestrictedBridgeResumed
 
 	for iter.Next() {
 		if iter.Event.Raw.BlockNumber == blockNumber &&
-			uint64(iter.Event.Raw.Index) == logIndex {
+			uint64(iter.Event.Raw.Index) == logIndex &&
+			iter.Event.Raw.TxHash.Hex() == txHash {
 			event = iter.Event
 
 			break
 		}
 	}
@@ -276,10 +282,11 @@ func (e *ERC20LogicView) FindBridgeResumed(
 
 func (e *ERC20LogicView) FindDeposit(
 	d *types.ERC20Deposit,
 	blockNumber, logIndex uint64,
 	ethAssetAddress string,
+	txHash string,
 ) error {
 	bf, err := bridgecontract.NewErc20BridgeLogicRestrictedFilterer(
 		e.clt.CollateralBridgeAddress(), e.clt)
 	if err != nil {
 		return err
@@ -313,11 +320,12 @@ func (e *ERC20LogicView) FindDeposit(
 
 	for iter.Next() {
 		if hex.EncodeToString(iter.Event.VegaPublicKey[:]) == targetPartyID &&
 			iter.Event.Amount.Cmp(depamount) == 0 &&
 			iter.Event.Raw.BlockNumber == blockNumber &&
-			uint64(iter.Event.Raw.Index) == logIndex {
+			uint64(iter.Event.Raw.Index) == logIndex &&
+			iter.Event.Raw.TxHash.Hex() == txHash {
 			event = iter.Event
 			break
 		}
 	}
 
@@ -335,10 +343,11 @@ func (e *ERC20LogicView) FindDeposit(
 
 func (e *ERC20LogicView) FindWithdrawal(
 	w *types.ERC20Withdrawal,
 	blockNumber, logIndex uint64,
 	ethAssetAddress string,
+	txHash string,
 ) (*big.Int, string, uint, error) {
 	bf, err := bridgecontract.NewErc20BridgeLogicRestrictedFilterer(
 		e.clt.CollateralBridgeAddress(), e.clt)
 	if err != nil {
 		return nil, "", 0, err
@@ -374,11 +383,12 @@ func (e *ERC20LogicView) FindWithdrawal(
 	}
 
 	for iter.Next() {
 		if nonce.Cmp(iter.Event.Nonce) == 0 &&
 			iter.Event.Raw.BlockNumber == blockNumber &&
-			uint64(iter.Event.Raw.Index) == logIndex {
+			uint64(iter.Event.Raw.Index) == logIndex &&
+			iter.Event.Raw.TxHash.Hex() == txHash {
 			event = iter.Event
 
 			break
 		}
 	}
@@ -397,10 +407,11 @@ func (e *ERC20LogicView) FindWithdrawal(
 
 func (e *ERC20LogicView) FindAssetLimitsUpdated(
 	update *types.ERC20AssetLimitsUpdated,
 	blockNumber uint64, logIndex uint64,
 	ethAssetAddress string,
+	txHash string,
 ) error {
 	bf, err := bridgecontract.NewErc20BridgeLogicRestrictedFilterer(
 		e.clt.CollateralBridgeAddress(), e.clt)
 	if err != nil {
 		return err
@@ -432,11 +443,12 @@ func (e *ERC20LogicView) FindAssetLimitsUpdated(
 		eventLifetimeLimit, _ := num.UintFromBig(iter.Event.LifetimeLimit)
 		eventWithdrawThreshold, _ := num.UintFromBig(iter.Event.WithdrawThreshold)
 		if update.LifetimeLimits.EQ(eventLifetimeLimit) &&
 			update.WithdrawThreshold.EQ(eventWithdrawThreshold) &&
 			iter.Event.Raw.BlockNumber == blockNumber &&
-			uint64(iter.Event.Raw.Index) == logIndex {
+			uint64(iter.Event.Raw.Index) == logIndex &&
+			iter.Event.Raw.TxHash.Hex() == txHash {
 			event = iter.Event
 			break
 		}
 	}
 
diff --git a/core/integration/stubs/bridge_view_stub.go b/core/integration/stubs/bridge_view_stub.go
index 4f762385c..3958f5755 100644
--- a/core/integration/stubs/bridge_view_stub.go
+++ b/core/integration/stubs/bridge_view_stub.go
@@ -20,24 +20,24 @@ type BridgeViewStub struct{}
 
 func NewBridgeViewStub() *BridgeViewStub {
 	return &BridgeViewStub{}
 }
 
-func (*BridgeViewStub) FindAssetList(al *types.ERC20AssetList, blockNumber, logIndex uint64) error {
+func (*BridgeViewStub) FindAssetList(al *types.ERC20AssetList, blockNumber, logIndex uint64, txHash string) error {
 	return nil
 }
 
-func (*BridgeViewStub) FindBridgeStopped(al *types.ERC20EventBridgeStopped, blockNumber, logIndex uint64) error {
+func (*BridgeViewStub) FindBridgeStopped(al *types.ERC20EventBridgeStopped, blockNumber, logIndex uint64, txHash string) error {
 	return nil
 }
 
-func (*BridgeViewStub) FindBridgeResumed(al *types.ERC20EventBridgeResumed, blockNumber, logIndex uint64) error {
+func (*BridgeViewStub) FindBridgeResumed(al *types.ERC20EventBridgeResumed, blockNumber, logIndex uint64, txHash string) error {
 	return nil
 }
 
-func (*BridgeViewStub) FindDeposit(d *types.ERC20Deposit, blockNumber, logIndex uint64, ethAssetAddress string) error {
+func (*BridgeViewStub) FindDeposit(d *types.ERC20Deposit, blockNumber, logIndex uint64, ethAssetAddress string, txHash string) error {
 	return nil
 }
 
-func (*BridgeViewStub) FindAssetLimitsUpdated(w *types.ERC20AssetLimitsUpdated, blockNumber, logIndex uint64, ethAssetAddress string) error {
+func (*BridgeViewStub) FindAssetLimitsUpdated(w *types.ERC20AssetLimitsUpdated, blockNumber, logIndex uint64, ethAssetAddress string, txHash string) error {
 	return nil
 }
diff --git a/core/staking/on_chain_verifier.go b/core/staking/on_chain_verifier.go
index 99788c2ab..949017d01 100644
--- a/core/staking/on_chain_verifier.go
+++ b/core/staking/on_chain_verifier.go
@@ -136,11 +136,12 @@ func (o *OnChainVerifier) CheckStakeDeposited(
 			}
 
 			if hex.EncodeToString(iter.Event.VegaPublicKey[:]) == vegaPubKey &&
 				iter.Event.Amount.Cmp(amountDeposited) == 0 &&
 				iter.Event.Raw.BlockNumber == event.BlockNumber &&
-				uint64(iter.Event.Raw.Index) == event.LogIndex {
+				uint64(iter.Event.Raw.Index) == event.LogIndex &&
+				iter.Event.Raw.TxHash.Hex() == event.TxID {
 				// now we know the event is OK,
 				// just need to check for confirmations
 				return o.ethConfirmations.Check(event.BlockNumber)
 			}
 		}
@@ -214,11 +215,12 @@ func (o *OnChainVerifier) CheckStakeRemoved(event *types.StakeRemoved) error {
 			}
 
 			if hex.EncodeToString(iter.Event.VegaPublicKey[:]) == vegaPubKey &&
 				iter.Event.Amount.Cmp(amountDeposited) == 0 &&
 				iter.Event.Raw.BlockNumber == event.BlockNumber &&
-				uint64(iter.Event.Raw.Index) == event.LogIndex {
+				uint64(iter.Event.Raw.Index) == event.LogIndex &&
+				iter.Event.Raw.TxHash.Hex() == event.TxID {
 				// now we know the event is OK,
 				// just need to check for confirmations
 				return o.ethConfirmations.Check(event.BlockNumber)
 			}
 		}
diff --git a/core/validators/erc20multisig/on_chain_verifier.go b/core/validators/erc20multisig/on_chain_verifier.go
index 228d1fc05..a0c77a09b 100644
--- a/core/validators/erc20multisig/on_chain_verifier.go
+++ b/core/validators/erc20multisig/on_chain_verifier.go
@@ -163,11 +163,12 @@ func (o *OnChainVerifier) CheckThresholdSetEvent(
 
 		nonce, _ := big.NewInt(0).SetString(event.Nonce, 10)
 		if iter.Event.Raw.BlockNumber == event.BlockNumber &&
 			uint64(iter.Event.Raw.Index) == event.LogIndex &&
 			iter.Event.NewThreshold == uint16(event.Threshold) &&
-			nonce.Cmp(iter.Event.Nonce) == 0 {
+			nonce.Cmp(iter.Event.Nonce) == 0 &&
+			iter.Event.Raw.TxHash.Hex() == event.TxHash {
 			// now we know the event is OK,
 			// just need to check for confirmations
 			return o.ethConfirmations.Check(event.BlockNumber)
 		}
 	}
@@ -203,11 +204,12 @@ func (o *OnChainVerifier) filterSignerAdded(
 
 		nonce, _ := big.NewInt(0).SetString(event.Nonce, 10)
 		if iter.Event.Raw.BlockNumber == event.BlockNumber &&
 			uint64(iter.Event.Raw.Index) == event.LogIndex &&
 			iter.Event.NewSigner.Hex() == event.Address &&
-			nonce.Cmp(iter.Event.Nonce) == 0 {
+			nonce.Cmp(iter.Event.Nonce) == 0 &&
+			iter.Event.Raw.TxHash.Hex() == event.TxHash {
 			// now we know the event is OK,
 			// just need to check for confirmations
 			return o.ethConfirmations.Check(event.BlockNumber)
 		}
 	}
@@ -243,11 +245,12 @@ func (o *OnChainVerifier) filterSignerRemoved(
 
 		nonce, _ := big.NewInt(0).SetString(event.Nonce, 10)
 		if iter.Event.Raw.BlockNumber == event.BlockNumber &&
 			uint64(iter.Event.Raw.Index) == event.LogIndex &&
 			iter.Event.OldSigner.Hex() == event.Address &&
-			nonce.Cmp(iter.Event.Nonce) == 0 {
+			nonce.Cmp(iter.Event.Nonce) == 0 &&
+			iter.Event.Raw.TxHash.Hex() == event.TxHash {
 			// now we know the event is OK,
 			// just need to check for confirmations
 			return o.ethConfirmations.Check(event.BlockNumber)
 		}
 	}

Vulnerable code: 		t.erc20BridgeStopped, t.blockHeight, t.logIndex)
		t.erc20BridgeResumed, t.blockHeight, t.logIndex)
		t.erc20D, t.blockHeight, t.logIndex, asset.Address(),
	return t.bridgeView.FindAssetList(t.erc20AL, t.blockHeight, t.logIndex)
		t.erc20AssetLimitsUpdated, t.blockHeight, t.logIndex, asset.Address(),
	FindAssetList(al *types.ERC20AssetList, blockNumber, logIndex uint64) error
	FindBridgeStopped(al *types.ERC20EventBridgeStopped, blockNumber, logIndex uint64) error
	FindBridgeResumed(al *types.ERC20EventBridgeResumed, blockNumber, logIndex uint64) error
	FindDeposit(d *types.ERC20Deposit, blockNumber, logIndex uint64, ethAssetAddress string) error
	FindAssetLimitsUpdated(update *types.ERC20AssetLimitsUpdated, blockNumber uint64, logIndex uint64, ethAssetAddress string) error
func (m *MockERC20BridgeView) FindAssetLimitsUpdated(arg0 *types.ERC20AssetLimitsUpdated, arg1, arg2 uint64, arg3 string) error {
	ret := m.ctrl.Call(m, "FindAssetLimitsUpdated", arg0, arg1, arg2, arg3)
func (mr *MockERC20BridgeViewMockRecorder) FindAssetLimitsUpdated(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindAssetLimitsUpdated", reflect.TypeOf((*MockERC20BridgeView)(nil).FindAssetLimitsUpdated), arg0, arg1, arg2, arg3)
func (m *MockERC20BridgeView) FindAssetList(arg0 *types.ERC20AssetList, arg1, arg2 uint64) error {
	ret := m.ctrl.Call(m, "FindAssetList", arg0, arg1, arg2)
func (mr *MockERC20BridgeViewMockRecorder) FindAssetList(arg0, arg1, arg2 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindAssetList", reflect.TypeOf((*MockERC20BridgeView)(nil).FindAssetList), arg0, arg1, arg2)
func (m *MockERC20BridgeView) FindBridgeResumed(arg0 *types.ERC20EventBridgeResumed, arg1, arg2 uint64) error {
	ret := m.ctrl.Call(m, "FindBridgeResumed", arg0, arg1, arg2)
func (mr *MockERC20BridgeViewMockRecorder) FindBridgeResumed(arg0, arg1, arg2 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindBridgeResumed", reflect.TypeOf((*MockERC20BridgeView)(nil).FindBridgeResumed), arg0, arg1, arg2)
func (m *MockERC20BridgeView) FindBridgeStopped(arg0 *types.ERC20EventBridgeStopped, arg1, arg2 uint64) error {
	ret := m.ctrl.Call(m, "FindBridgeStopped", arg0, arg1, arg2)
func (mr *MockERC20BridgeViewMockRecorder) FindBridgeStopped(arg0, arg1, arg2 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindBridgeStopped", reflect.TypeOf((*MockERC20BridgeView)(nil).FindBridgeStopped), arg0, arg1, arg2)
func (m *MockERC20BridgeView) FindDeposit(arg0 *types.ERC20Deposit, arg1, arg2 uint64, arg3 string) error {
	ret := m.ctrl.Call(m, "FindDeposit", arg0, arg1, arg2, arg3)
func (mr *MockERC20BridgeViewMockRecorder) FindDeposit(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindDeposit", reflect.TypeOf((*MockERC20BridgeView)(nil).FindDeposit), arg0, arg1, arg2, arg3)
			uint64(iter.Event.Raw.Index) == logIndex {
			uint64(iter.Event.Raw.Index) == logIndex {
			uint64(iter.Event.Raw.Index) == logIndex {
			uint64(iter.Event.Raw.Index) == logIndex {
			uint64(iter.Event.Raw.Index) == logIndex {
			uint64(iter.Event.Raw.Index) == logIndex {
func (*BridgeViewStub) FindAssetList(al *types.ERC20AssetList, blockNumber, logIndex uint64) error {
func (*BridgeViewStub) FindBridgeStopped(al *types.ERC20EventBridgeStopped, blockNumber, logIndex uint64) error {
func (*BridgeViewStub) FindBridgeResumed(al *types.ERC20EventBridgeResumed, blockNumber, logIndex uint64) error {
func (*BridgeViewStub) FindDeposit(d *types.ERC20Deposit, blockNumber, logIndex uint64, ethAssetAddress string) error {
func (*BridgeViewStub) FindAssetLimitsUpdated(w *types.ERC20AssetLimitsUpdated, blockNumber, logIndex uint64, ethAssetAddress string) error {
				uint64(iter.Event.Raw.Index) == event.LogIndex {
				uint64(iter.Event.Raw.Index) == event.LogIndex {
			nonce.Cmp(iter.Event.Nonce) == 0 {
			nonce.Cmp(iter.Event.Nonce) == 0 {
			nonce.Cmp(iter.Event.Nonce) == 0 {
Fixed code: 		t.erc20BridgeStopped, t.blockHeight, t.logIndex, t.txHash)
		t.erc20BridgeResumed, t.blockHeight, t.logIndex, t.txHash)
		t.erc20D, t.blockHeight, t.logIndex, asset.Address(), t.txHash,
	return t.bridgeView.FindAssetList(t.erc20AL, t.blockHeight, t.logIndex, t.txHash)
		t.erc20AssetLimitsUpdated, t.blockHeight, t.logIndex, asset.Address(), t.txHash,
	FindAssetList(al *types.ERC20AssetList, blockNumber, logIndex uint64, txHash string) error
	FindBridgeStopped(al *types.ERC20EventBridgeStopped, blockNumber, logIndex uint64, txHash string) error
	FindBridgeResumed(al *types.ERC20EventBridgeResumed, blockNumber, logIndex uint64, txHash string) error
	FindDeposit(d *types.ERC20Deposit, blockNumber, logIndex uint64, ethAssetAddress string, txHash string) error
	FindAssetLimitsUpdated(update *types.ERC20AssetLimitsUpdated, blockNumber uint64, logIndex uint64, ethAssetAddress string, txHash string) error
func (m *MockERC20BridgeView) FindAssetLimitsUpdated(arg0 *types.ERC20AssetLimitsUpdated, arg1, arg2 uint64, arg3, arg4 string) error {
	ret := m.ctrl.Call(m, "FindAssetLimitsUpdated", arg0, arg1, arg2, arg3, arg4)
func (mr *MockERC20BridgeViewMockRecorder) FindAssetLimitsUpdated(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindAssetLimitsUpdated", reflect.TypeOf((*MockERC20BridgeView)(nil).FindAssetLimitsUpdated), arg0, arg1, arg2, arg3, arg4)
func (m *MockERC20BridgeView) FindAssetList(arg0 *types.ERC20AssetList, arg1, arg2 uint64, arg3 string) error {
	ret := m.ctrl.Call(m, "FindAssetList", arg0, arg1, arg2, arg3)
func (mr *MockERC20BridgeViewMockRecorder) FindAssetList(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindAssetList", reflect.TypeOf((*MockERC20BridgeView)(nil).FindAssetList), arg0, arg1, arg2, arg3)
func (m *MockERC20BridgeView) FindBridgeResumed(arg0 *types.ERC20EventBridgeResumed, arg1, arg2 uint64, arg3 string) error {
	ret := m.ctrl.Call(m, "FindBridgeResumed", arg0, arg1, arg2, arg3)
func (mr *MockERC20BridgeViewMockRecorder) FindBridgeResumed(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindBridgeResumed", reflect.TypeOf((*MockERC20BridgeView)(nil).FindBridgeResumed), arg0, arg1, arg2, arg3)
func (m *MockERC20BridgeView) FindBridgeStopped(arg0 *types.ERC20EventBridgeStopped, arg1, arg2 uint64, arg3 string) error {
	ret := m.ctrl.Call(m, "FindBridgeStopped", arg0, arg1, arg2, arg3)
func (mr *MockERC20BridgeViewMockRecorder) FindBridgeStopped(arg0, arg1, arg2, arg3 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindBridgeStopped", reflect.TypeOf((*MockERC20BridgeView)(nil).FindBridgeStopped), arg0, arg1, arg2, arg3)
func (m *MockERC20BridgeView) FindDeposit(arg0 *types.ERC20Deposit, arg1, arg2 uint64, arg3, arg4 string) error {
	ret := m.ctrl.Call(m, "FindDeposit", arg0, arg1, arg2, arg3, arg4)
func (mr *MockERC20BridgeViewMockRecorder) FindDeposit(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindDeposit", reflect.TypeOf((*MockERC20BridgeView)(nil).FindDeposit), arg0, arg1, arg2, arg3, arg4)
	txHash string,
			uint64(iter.Event.Raw.Index) == logIndex &&
			iter.Event.Raw.TxHash.Hex() == txHash {
	txHash string,
			uint64(iter.Event.Raw.Index) == logIndex &&
			iter.Event.Raw.TxHash.Hex() == txHash {
	txHash string,
			uint64(iter.Event.Raw.Index) == logIndex &&
			iter.Event.Raw.TxHash.Hex() == txHash {
	txHash string,
			uint64(iter.Event.Raw.Index) == logIndex &&
			iter.Event.Raw.TxHash.Hex() == txHash {
	txHash string,
			uint64(iter.Event.Raw.Index) == logIndex &&
			iter.Event.Raw.TxHash.Hex() == txHash {
	txHash string,
			uint64(iter.Event.Raw.Index) == logIndex &&
			iter.Event.Raw.TxHash.Hex() == txHash {
func (*BridgeViewStub) FindAssetList(al *types.ERC20AssetList, blockNumber, logIndex uint64, txHash string) error {
func (*BridgeViewStub) FindBridgeStopped(al *types.ERC20EventBridgeStopped, blockNumber, logIndex uint64, txHash string) error {
func (*BridgeViewStub) FindBridgeResumed(al *types.ERC20EventBridgeResumed, blockNumber, logIndex uint64, txHash string) error {
func (*BridgeViewStub) FindDeposit(d *types.ERC20Deposit, blockNumber, logIndex uint64, ethAssetAddress string, txHash string) error {
func (*BridgeViewStub) FindAssetLimitsUpdated(w *types.ERC20AssetLimitsUpdated, blockNumber, logIndex uint64, ethAssetAddress string, txHash string) error {
				uint64(iter.Event.Raw.Index) == event.LogIndex &&
				iter.Event.Raw.TxHash.Hex() == event.TxID {
				uint64(iter.Event.Raw.Index) == event.LogIndex &&
				iter.Event.Raw.TxHash.Hex() == event.TxID {
			nonce.Cmp(iter.Event.Nonce) == 0 &&
			iter.Event.Raw.TxHash.Hex() == event.TxHash {
			nonce.Cmp(iter.Event.Nonce) == 0 &&
			iter.Event.Raw.TxHash.Hex() == event.TxHash {
			nonce.Cmp(iter.Event.Nonce) == 0 &&
			iter.Event.Raw.TxHash.Hex() == event.TxHash {