{"record":{"id":"52093c26ec064ed3","repo":"hyperledger/fabric","slug":"invalid-proposal-s-signatureheader-during-channell","errorCode":null,"errorMessage":"Invalid Proposal's SignatureHeader during channelless check policy with policy [%s]: [%s]","messagePattern":"Invalid Proposal's SignatureHeader during channelless check policy with policy \\[(.+?)\\]: \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/policy/policy.go","lineNumber":128,"sourceCode":"\t}\n\n\tif signedProp == nil {\n\t\treturn fmt.Errorf(\"Invalid signed proposal during channelless check policy with policy [%s]\", policyName)\n\t}\n\n\tproposal, err := protoutil.UnmarshalProposal(signedProp.ProposalBytes)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failing extracting proposal during channelless check policy with policy [%s]: [%s]\", policyName, err)\n\t}\n\n\theader, err := protoutil.UnmarshalHeader(proposal.Header)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failing extracting header during channelless check policy with policy [%s]: [%s]\", policyName, err)\n\t}\n\n\tshdr, err := protoutil.UnmarshalSignatureHeader(header.SignatureHeader)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Invalid Proposal's SignatureHeader during channelless check policy with policy [%s]: [%s]\", policyName, err)\n\t}\n\n\t// Deserialize proposal's creator with the local MSP\n\tid, err := p.localMSP.DeserializeIdentity(shdr.Creator)\n\tif err != nil {\n\t\tlogger.Warnw(\"Failed deserializing proposal creator during channelless check policy\", \"error\", err, \"policyName\", policyName, \"identity\", protoutil.LogMessageForSerializedIdentity(shdr.Creator))\n\t\treturn fmt.Errorf(\"Failed deserializing proposal creator during channelless check policy with policy [%s]: [%s]\", policyName, err)\n\t}\n\n\t// Load MSPPrincipal for policy\n\tprincipal, err := p.principalGetter.Get(policyName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Failed getting local MSP principal during channelless check policy with policy [%s]: [%s]\", policyName, err)\n\t}\n\n\t// Verify that proposal's creator satisfies the principal\n\terr = id.SatisfiesPrincipal(principal)\n\tif err != nil {","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/policy/policy.go#L110-L146","documentation":"The Proposal and Header unmarshaled fine, but header.SignatureHeader could not be decoded into a common.SignatureHeader, which carries the creator identity and nonce. Since the channelless policy check must deserialize the creator to evaluate the local MSP principal, a broken SignatureHeader is fatal to the check.","triggerScenarios":"SignedProposal whose header decodes but whose SignatureHeader field is empty/garbage — e.g. header constructed without a SignatureHeader, or bytes assigned to the wrong field of common.Header, or truncation in transit.","commonSituations":"Clients assembling common.Header manually and filling only ChannelHeader; signing code that clears/mutates SignatureHeader after signing; corrupted messages from a buggy gateway.","solutions":["Populate common.SignatureHeader (Creator = marshaled serialized identity, Nonce) and marshal it into header.SignatureHeader on the client.","Before sending, round-trip unmarshal header.SignatureHeader locally to verify it is a valid SignatureHeader.","Ensure Creator bytes come from msp.SerializationOfIdentity / the SDK's identity serializer, not raw certificates or PEM blobs.","Check transport for truncation and confirm byte lengths match client-side marshaled sizes."],"exampleFix":"// before\nhdr := &common.Header{ChannelHeader: chBytes} // SignatureHeader missing\n\n// after\nshBytes, err := protoutil.Marshal(&common.SignatureHeader{Creator: creator, Nonce: nonce})\nif err != nil { return err }\nhdr := &common.Header{ChannelHeader: chBytes, SignatureHeader: shBytes}","handlingStrategy":"validation","validationCode":"hdr, err := protoutil.UnmarshalHeader(proposal.Header)\nif err != nil { return err }\nif len(hdr.SignatureHeader) == 0 {\n    return errors.New(\"header.SignatureHeader is empty\")\n}\nif _, err := protoutil.UnmarshalSignatureHeader(hdr.SignatureHeader); err != nil {\n    return fmt.Errorf(\"invalid SignatureHeader: %w\", err)\n}","typeGuard":"func hasValidSignatureHeader(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":"err := policyMgr.CheckPolicy(policyName, signedProp)\nif err != nil && strings.Contains(err.Error(), \"SignatureHeader\") {\n    // rebuild SignatureHeader with creator+nonce and re-sign\n}","preventionTips":["Always populate common.SignatureHeader with Creator and Nonce before marshaling the Header","Use protoutil utilities (or SDK proposal builders) to assemble headers","Round-trip unmarshal the complete Header before signing the proposal","Keep client proto packages current with the peer's Fabric release"],"tags":["hyperledger-fabric","protobuf","proposal-validation"],"backgroundTag":"protobuf-unmarshal-failed","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"}