{"record":{"id":"8f1dec0230e3227f","repo":"hyperledger/fabric","slug":"failed-parsing-channel-header","errorCode":null,"errorMessage":"failed parsing channel header","messagePattern":"failed parsing channel header","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/handlers/auth/filter/timewindow.go","lineNumber":49,"sourceCode":"// Init initializes the Filter with the next EndorserServer\nfunc (f *timewindowCheckFilter) Init(next peer.EndorserServer) {\n\tf.next = next\n}\n\nfunc validateTimewindowProposal(signedProp *peer.SignedProposal, timeWindow time.Duration) error {\n\tprop, err := protoutil.UnmarshalProposal(signedProp.ProposalBytes)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed parsing proposal\")\n\t}\n\n\thdr, err := protoutil.UnmarshalHeader(prop.Header)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed parsing header\")\n\t}\n\n\tchdr, err := protoutil.UnmarshalChannelHeader(hdr.ChannelHeader)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed parsing channel header\")\n\t}\n\n\ttimeProposal := chdr.Timestamp.AsTime().UTC()\n\tnow := time.Now().UTC()\n\n\tif timeProposal.Add(timeWindow).Before(now) || timeProposal.Add(-timeWindow).After(now) {\n\t\treturn errors.Errorf(\"request unauthorized due to incorrect timestamp %s, peer time %s, peer.authentication.timewindow %s\",\n\t\t\ttimeProposal.Format(time.RFC3339), now.Format(time.RFC3339), timeWindow.String())\n\t}\n\n\treturn nil\n}\n\n// ProcessProposal processes a signed proposal\nfunc (f *timewindowCheckFilter) ProcessProposal(ctx context.Context, signedProp *peer.SignedProposal) (*peer.ProposalResponse, error) {\n\tif err := validateTimewindowProposal(signedProp, f.timeWindow); err != nil {\n\t\treturn nil, err\n\t}","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/auth/filter/timewindow.go#L31-L67","documentation":"Returned by validateTimewindowProposal when protoutil.UnmarshalChannelHeader fails on the header's ChannelHeader bytes. Without a channel header carrying the timestamp, the timewindow replay protection cannot evaluate the proposal.","triggerScenarios":"Thrown at core/handlers/auth/filter/timewindow.go:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the client serializes a valid ChannelHeader (including a Timestamp)","Reject the malformed proposal"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}