{"record":{"id":"fac98ce48973898d","repo":"hyperledger/fabric","slug":"invalid-signed-proposal-during-channelless-check-p","errorCode":null,"errorMessage":"Invalid signed proposal during channelless check policy with policy [%s]","messagePattern":"Invalid signed proposal during channelless check policy with policy \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/policy/policy.go","lineNumber":113,"sourceCode":"\n\tsd := []*protoutil.SignedData{{\n\t\tData:      signedProp.ProposalBytes,\n\t\tIdentity:  shdr.Creator,\n\t\tSignature: signedProp.Signature,\n\t}}\n\n\treturn p.CheckPolicyBySignedData(channelID, policyName, sd)\n}\n\n// CheckPolicyNoChannel checks that the passed signed proposal is valid with the respect to\n// passed policy on the local MSP.\nfunc (p *policyChecker) CheckPolicyNoChannel(policyName string, signedProp *pb.SignedProposal) error {\n\tif policyName == \"\" {\n\t\treturn errors.New(\"Invalid policy name during channelless check policy. Name must be different from nil.\")\n\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","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/policy/policy.go#L95-L131","documentation":"After the policy name check, CheckPolicyNoChannel verifies a SignedProposal was actually supplied. Since signedProp is a *pb.SignedProposal pointer, passing nil means there is nothing to authenticate, so the function returns this error naming the requested policy.","triggerScenarios":"Calling CheckPolicyNoChannel with a nil *pb.SignedProposal, or a caller that propagated a nil proposal from an earlier failed decode.","commonSituations":"Unmarshaling a client request into SignedProposal that returned nil on error but the error was ignored; request handlers on the peer (channelless system chaincode calls) receiving malformed/missing proposal fields.","solutions":["Ensure the caller constructs a valid SignedProposal (ProposalBytes + Signature) before the call","Check the caller's unmarshal/decode path for ignored errors that yield a nil proposal","Add a nil check in the calling code before invoking CheckPolicyNoChannel"],"exampleFix":"// before\nvar signedProp *pb.SignedProposal\nerr := pc.CheckPolicyNoChannel(\"Users\", signedProp)\n// after\nif signedProp == nil || signedProp.ProposalBytes == nil {\n    return errors.New(\"signed proposal required\")\n}\nerr := pc.CheckPolicyNoChannel(\"Users\", signedProp)","handlingStrategy":"type-guard","validationCode":"if signedProp == nil { return errors.New(\"signed proposal required\") }","typeGuard":"function isSignedProposal(sp) { return sp != null && sp.proposal_bytes != null && sp.signature != null; }","tryCatchPattern":"err := checker.CheckPolicyNoChannel(policyName, signedProp)\nif err != nil {\n    if strings.Contains(err.Error(), \"Invalid signed proposal during channelless check policy\") {\n        // nil proposal upstream: audit decode path\n    }\n    return err\n}","preventionTips":["Always check decode/unmarshal errors before using proposal pointers","Nil-guard at API entry points","Require both ProposalBytes and Signature fields","Favor explicit construction over zero-value structs"],"tags":["hyperledger-fabric","policy","nil-pointer","validation"],"backgroundTag":"nil-signed-proposal","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"}