{"record":{"id":"e33e5e00fe54161e","repo":"hyperledger/fabric","slug":"invalid-config-envelope-e33e5e","errorCode":null,"errorMessage":"invalid config envelope","messagePattern":"invalid config envelope","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/consensus/smartbft/configverifier.go","lineNumber":194,"sourceCode":"\tif err := proto.Unmarshal(consensusTypeConfigValue.Value, consensusTypeValue); err != nil {\n\t\treturn fmt.Errorf(\"invalid consensus type property in config: %v\", err)\n\t}\n\n\tconfigOptions := &smartbft.Options{}\n\tif err := proto.Unmarshal(consensusTypeValue.Metadata, configOptions); err != nil {\n\t\treturn fmt.Errorf(\"invalid options encoded in consensus metadata: %v\", err)\n\t}\n\n\tif configOptions.LeaderRotation == smartbft.Options_ROTATION_ON {\n\t\treturn fmt.Errorf(\"leader rotation must be turned off for this version or be unspecified\")\n\t}\n\n\treturn nil\n}\n\nfunc (cbv *ConfigBlockValidator) verifyConfigUpdateMsg(outEnv *common.Envelope, confEnv *common.ConfigEnvelope, chdr *common.ChannelHeader) error {\n\tif confEnv == nil || confEnv.LastUpdate == nil || confEnv.Config == nil {\n\t\treturn errors.New(\"invalid config envelope\")\n\t}\n\tenvPayload, err := protoutil.UnmarshalPayload(confEnv.LastUpdate.Payload)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif envPayload.Header == nil {\n\t\treturn errors.New(\"inner header is nil\")\n\t}\n\n\tif envPayload.Header.ChannelHeader == nil {\n\t\treturn errors.New(\"inner channelheader is nil\")\n\t}\n\n\ttyp := common.HeaderType(chdr.Type)\n\n\tcbv.Logger.Infof(\"Applying filters for config update of type %s to channel %s\", typ, chdr.ChannelId)\n","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/consensus/smartbft/configverifier.go#L176-L212","documentation":"ValidateConfig hands the config envelope to verifyConfigUpdateMsg, which requires the envelope to contain a LastUpdate and a Config. A nil/empty ConfigEnvelope means the block being validated does not actually carry a usable config, so validation fails immediately.","triggerScenarios":"verifyConfigUpdateMsg called with confEnv == nil, confEnv.LastUpdate == nil, or confEnv.Config == nil — i.e. the ConfigEnvelope extracted from the block is incomplete.","commonSituations":"Submitting a malformed config transaction whose payload lacks the config update; a block containing a truncated or empty config envelope; custom clients sending CONFIG transactions with wrong inner structure.","solutions":["Ensure the config transaction envelope contains a proper ConfigUpdateEnvelope as LastUpdate and a computed Config","Rebuild the config submission using the standard config update flow (fetch current config, compute update, sign, submit)","Inspect the block payload to confirm the ConfigEnvelope fields are populated before submitting"],"exampleFix":"// before\nenv := &common.ConfigEnvelope{Config: cfg} // LastUpdate missing\n// after\nenv := &common.ConfigEnvelope{Config: cfg, LastUpdate: signedConfigUpdateEnvelope}","handlingStrategy":"type-guard","validationCode":"if confEnv == nil || confEnv.LastUpdate == nil || confEnv.Config == nil {\n    return errors.New(\"config envelope incomplete: need Config and LastUpdate\")\n}","typeGuard":"func validConfigEnvelope(confEnv *common.ConfigEnvelope) bool {\n    return confEnv != nil && confEnv.LastUpdate != nil && confEnv.Config != nil\n}","tryCatchPattern":null,"preventionTips":["Assemble config transactions only through the standard update flow","Validate envelope completeness before broadcast","Never submit empty or partially built CONFIG blocks"],"tags":["hyperledger-fabric","smartbft","config-envelope","malformed-input"],"backgroundTag":"malformed-config-envelope","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}