{"record":{"id":"e326b5fc83ff5927","repo":"hyperledger/fabric","slug":"nil-signatureheader-provided","errorCode":null,"errorMessage":"nil SignatureHeader provided","messagePattern":"nil SignatureHeader provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/common/validation/msgvalidation.go","lineNumber":70,"sourceCode":"\n\tputilsLogger.Debugf(\"creator is valid\")\n\n\t// validate the signature\n\terr = creator.Verify(msg, sig)\n\tif err != nil {\n\t\treturn errors.WithMessage(err, \"creator's signature over the proposal is not valid\")\n\t}\n\n\tputilsLogger.Debugf(\"exits successfully\")\n\n\treturn nil\n}\n\n// checks for a valid SignatureHeader\nfunc validateSignatureHeader(sHdr *common.SignatureHeader) error {\n\t// check for nil argument\n\tif sHdr == nil {\n\t\treturn errors.New(\"nil SignatureHeader provided\")\n\t}\n\n\t// ensure that there is a nonce\n\tif len(sHdr.Nonce) == 0 {\n\t\treturn errors.New(\"invalid nonce specified in the header\")\n\t}\n\n\t// ensure that there is a creator\n\tif len(sHdr.Creator) == 0 {\n\t\treturn errors.New(\"invalid creator specified in the header\")\n\t}\n\n\treturn nil\n}\n\n// checks for a valid ChannelHeader\nfunc validateChannelHeader(cHdr *common.ChannelHeader) error {\n\t// check for nil argument","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/common/validation/msgvalidation.go#L52-L88","documentation":"validateSignatureHeader checks the SignatureHeader portion of a transaction header. A nil SignatureHeader pointer means the header could not be parsed or was never set, so no signature metadata (nonce, creator) exists to validate. The function rejects it immediately.","triggerScenarios":"validateCommonHeader -> validateSignatureHeader invoked with hdr.SignatureHeader bytes that are nil/empty, or protoutil.UnmarshalSignatureHeader returning a nil pointer in a malformed envelope.","commonSituations":"Client SDKs omitting the signature header when building proposals/envelopes; corrupted or truncated protobuf payloads; hand-built messages in tests missing the SignatureHeader.","solutions":["Populate Header.SignatureHeader (with Nonce and serialized Creator) when constructing the transaction client-side","Check the SDK's transaction-building call to confirm the signature header is set (e.g. TransactionID from nonce+creator)","Verify the envelope bytes were not truncated during transport — re-unmarshal and inspect hdr.SignatureHeader","In tests, construct a valid SignatureHeader via protoutil or the common package helpers"],"exampleFix":"// before\nhdr := &common.Header{ChannelHeader: chdrBytes} // SignatureHeader missing\n// after\nshdrBytes := protoutil.MarshalOrPanic(&common.SignatureHeader{Creator: creatorBytes, Nonce: nonce})\nhdr := &common.Header{ChannelHeader: chdrBytes, SignatureHeader: shdrBytes}","handlingStrategy":"validation","validationCode":"func hasSignatureHeader(hdr *common.Header) bool {\n    return hdr != nil && len(hdr.SignatureHeader) > 0\n}","typeGuard":"func signatureHeaderPresent(hdr *common.Header) bool {\n    if hdr == nil || len(hdr.SignatureHeader) == 0 {\n        return false\n    }\n    _, err := protoutil.UnmarshalSignatureHeader(hdr.SignatureHeader)\n    return err == nil\n}","tryCatchPattern":"chdr, shdr, err := validation.ValidateTransaction returns wrapped errors; if err.Error() == \"nil SignatureHeader provided\" {\n    // flag envelope as malformed, do not retry\n}","preventionTips":["Build headers with protoutil helpers rather than raw structs","Verify SignatureHeader bytes exist right after unmarshalling the payload","Check envelope integrity (length/CRC) if payloads cross unreliable transports"],"tags":["hyperledger-fabric","validation","signature-header","protobuf"],"backgroundTag":"malformed-transaction-header","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}