Headline
CVE-2023-33964: Merge pull request from GHSA-7xpv-4pm9-xch2 · multiversx/mx-chain-go@9729547
mx-chain-go is an implementation of the MultiversX blockchain protocol written in the Go language. Metachain cannot process a cross-shard miniblock. Prior to version 1.4.16, an invalid transaction with the wrong username on metachain is not treated correctly on the metachain transaction processor. This is strictly a processing issue that could have happened on MultiversX chain. If an error like this had occurred, the metachain would have stopped notarizing blocks from the shard chains. The resuming of notarization is possible only after applying a patched binary version. A patch in version 1.4.16 introduces processIfTxErrorCrossShard
for the metachain transaction processor. There are no known workarounds for this issue.
Expand Up @@ -5,16 +5,19 @@ import ( “math/big” “testing”
“github.com/multiversx/mx-chain-core-go/core” “github.com/multiversx/mx-chain-core-go/data” “github.com/multiversx/mx-chain-core-go/data/transaction” “github.com/multiversx/mx-chain-go/process” “github.com/multiversx/mx-chain-go/process/coordinator” “github.com/multiversx/mx-chain-go/process/mock” txproc “github.com/multiversx/mx-chain-go/process/transaction” “github.com/multiversx/mx-chain-go/sharding” “github.com/multiversx/mx-chain-go/state” “github.com/multiversx/mx-chain-go/testscommon” “github.com/multiversx/mx-chain-go/testscommon/hashingMocks” stateMock “github.com/multiversx/mx-chain-go/testscommon/state” “github.com/multiversx/mx-chain-go/vm” vmcommon “github.com/multiversx/mx-chain-vm-common-go” “github.com/multiversx/mx-chain-vm-common-go/builtInFunctions” “github.com/multiversx/mx-chain-vm-common-go/parsers” Expand Down Expand Up @@ -446,3 +449,42 @@ func TestMetaTxProcessor_ProcessTransactionBuiltInCallTxShouldWork(t *testing.T) assert.True(t, builtInCalled) assert.Equal(t, 0, saveAccountCalled) }
func TestMetaTxProcessor_ProcessTransactionWithInvalidUsernameShouldNotError(t *testing.T) { t.Parallel()
tx := &transaction.Transaction{} tx.Nonce = 0 tx.SndAddr = bytes.Repeat([]byte{1}, 32) tx.RcvAddr = vm.GovernanceSCAddress tx.RcvUserName = []byte(“username”) tx.Value = big.NewInt(45) tx.GasPrice = 1 tx.GasLimit = 1
acntDst, err := state.NewUserAccount(tx.RcvAddr) assert.Nil(t, err)
called := false adb := createAccountStub(tx.SndAddr, tx.RcvAddr, acntDst, acntDst) scProcessor := &testscommon.SCProcessorMock{ ProcessIfErrorCalled: func(acntSnd state.UserAccountHandler, txHash []byte, tx data.TransactionHandler, returnCode string, returnMessage []byte, snapshot int, gasLocked uint64) error { called = true return nil }, }
args := createMockNewMetaTxArgs() args.Accounts = adb args.ScProcessor = scProcessor args.ShardCoordinator, _ = sharding.NewMultiShardCoordinator(3, core.MetachainShardId) txProc, _ := txproc.NewMetaTxProcessor(args)
err = txProc.VerifyTransaction(tx) assert.Equal(t, err, process.ErrUserNameDoesNotMatchInCrossShardTx)
returnCode, err := txProc.ProcessTransaction(tx) assert.Nil(t, err) assert.Equal(t, vmcommon.UserError, returnCode) assert.True(t, called) }
Related news
### Impact Metachain cannot process a cross-shard miniblock. An invalid transaction with the wrong username on metachain is not treated correctly on the metachain transaction processor. This is strictly a processing issue that could have happened on MultiversX chain. If an error like this had occurred, the metachain would have stopped notarizing blocks from the shard chains. The resuming of notarization is possible only after applying a patched binary version. ### Patches Introduce processIfTxErrorCrossShard for metachain transaction processor. ### Workarounds No ### References No