{"record":{"id":"55f0f298f84dbf27","repo":"hyperledger/fabric","slug":"inconsistent-ccid-info-s-s","errorCode":null,"errorMessage":"inconsistent ccid info (%s/%s)","messagePattern":"inconsistent ccid info \\((.+?)/(.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/committer/txvalidator/v14/vscc_validator.go","lineNumber":106,"sourceCode":"\t\treturn peer.TxValidationCode_INVALID_OTHER_REASON, errors.New(\"nil ChaincodeId in header extension\")\n\t}\n\n\tif respPayload.ChaincodeId == nil {\n\t\treturn peer.TxValidationCode_INVALID_OTHER_REASON, errors.New(\"nil ChaincodeId in ChaincodeAction\")\n\t}\n\n\t// get name and version of the cc we invoked\n\tccID := hdrExt.ChaincodeId.Name\n\tccVer := respPayload.ChaincodeId.Version\n\n\t// sanity check on ccID\n\tif ccID == \"\" {\n\t\terr = errors.New(\"invalid chaincode ID\")\n\t\tlogger.Errorf(\"%+v\", err)\n\t\treturn peer.TxValidationCode_INVALID_OTHER_REASON, err\n\t}\n\tif ccID != respPayload.ChaincodeId.Name {\n\t\terr = errors.Errorf(\"inconsistent ccid info (%s/%s)\", ccID, respPayload.ChaincodeId.Name)\n\t\tlogger.Errorf(\"%+v\", err)\n\t\treturn peer.TxValidationCode_INVALID_OTHER_REASON, err\n\t}\n\t// sanity check on ccver\n\tif ccVer == \"\" {\n\t\terr = errors.New(\"invalid chaincode version\")\n\t\tlogger.Errorf(\"%+v\", err)\n\t\treturn peer.TxValidationCode_INVALID_OTHER_REASON, err\n\t}\n\n\tvar wrNamespace []string\n\talwaysEnforceOriginalNamespace := v.cr.Capabilities().V1_2Validation()\n\tif alwaysEnforceOriginalNamespace {\n\t\twrNamespace = append(wrNamespace, ccID)\n\t\tif respPayload.Events != nil {\n\t\t\tccEvent := &peer.ChaincodeEvent{}\n\t\t\tif err = proto.Unmarshal(respPayload.Events, ccEvent); err != nil {\n\t\t\t\treturn peer.TxValidationCode_INVALID_OTHER_REASON, errors.Wrapf(err, \"invalid chaincode event\")","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/committer/txvalidator/v14/vscc_validator.go#L88-L124","documentation":"The chaincode name in the header extension (ccID) differs from the chaincode name reported in the chaincode action's response payload (respPayload.ChaincodeId.Name). VSCC rejects the transaction as TxValidationCode_INVALID_OTHER_REASON because this inconsistency indicates a forged or mismatched endorsement result.","triggerScenarios":"A transaction whose header extension names chaincode A while the endorsed ChaincodeAction says chaincode B — produced by clients reusing headers across invokes, mixing endorsement responses, or maliciously swapping payloads.","commonSituations":"Client bug reusing a cached proposal/header for a different chaincode; manual stitching of proposal responses from different invocations; tampering attempts blocked by validation.","solutions":["Rebuild the transaction with the SDK so header extension and endorsement responses come from the same proposal/invocation.","Stop caching/reusing proposal payloads or headers across different chaincode invocations.","If seen unexpectedly on network, investigate the submitting client(s) or potential payload tampering."],"exampleFix":"// before: reusing old hdrExt for new response\nhdrExt := oldHeaderExtension\nrespPayload := buildActionFor(\"othercc\")\n// after: build envelope from a single proposal flow\ntransaction, _ := channel.CreateTransaction(responsesFromSameProposal)","handlingStrategy":"validation","validationCode":"if hdrExt.ChaincodeId.Name != respPayload.ChaincodeId.Name {\n    return fmt.Errorf(\"header chaincode %q does not match action chaincode %q; rebuild the transaction\", hdrExt.ChaincodeId.Name, respPayload.ChaincodeId.Name)\n}","typeGuard":"func consistentChaincodeIds(hdrExt *peer.ChaincodeHeaderExtension, action *peer.ChaincodeAction) bool {\n\treturn hdrExt != nil && hdrExt.ChaincodeId != nil &&\n\t\taction != nil && action.ChaincodeId != nil &&\n\t\thdrExt.ChaincodeId.Name == action.ChaincodeId.Name\n}","tryCatchPattern":"if ccID != respPayload.ChaincodeId.Name {\n    logger.Warnf(\"tx rejected: inconsistent ccid info (%s/%s)\", ccID, respPayload.ChaincodeId.Name)\n    return peer.TxValidationCode_INVALID_OTHER_REASON, nil\n}","preventionTips":["Never reuse proposal headers or cached endorsements across different chaincode invocations.","Assemble each transaction from the responses of its single original proposal.","Avoid any middleware that rewrites envelope contents in transit."],"tags":["fabric","transaction-validation","payload-mismatch"],"backgroundTag":"invalid-chaincode-id","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"}