{"record":{"id":"7997817be86f796c","repo":"hyperledger/fabric","slug":"inconsistent-ccid-info-s-s-799781","errorCode":null,"errorMessage":"inconsistent ccid info (%s/%s)","messagePattern":"inconsistent ccid info \\((.+?)/(.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/committer/txvalidator/v20/plugindispatcher/dispatcher.go","lineNumber":148,"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_CHAINCODE, 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_CHAINCODE, 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_CHAINCODE, err\n\t}\n\n\twrNamespace := map[string]bool{}\n\twrNamespace[ccID] = true\n\tif respPayload.Events != nil {\n\t\tccEvent := &peer.ChaincodeEvent{}\n\t\tif err = proto.Unmarshal(respPayload.Events, ccEvent); err != nil {\n\t\t\treturn peer.TxValidationCode_INVALID_OTHER_REASON, errors.Wrapf(err, \"invalid chaincode event\")\n\t\t}\n\t\tif ccEvent.ChaincodeId != ccID {","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/committer/txvalidator/v20/plugindispatcher/dispatcher.go#L130-L166","documentation":"The chaincode name in the transaction's header extension (ccID) does not match the ChaincodeId.Name embedded in the chaincode action's response payload (respPayload.ChaincodeId.Name). Fabric throws this because a mismatch indicates the action was not produced by the chaincode named in the proposal header — a tampering or corruption signal.","triggerScenarios":"During Dispatch validation, hdrExt.ChaincodeId.Name != respPayload.ChaincodeId.Name. Occurs when a response payload from one chaincode is spliced into an envelope whose header names a different chaincode, or when payloads are re-used/re-signed incorrectly.","commonSituations":"Custom transaction builders that copy respPayload between transactions; replay/mix-and-match attacks caught by the validator; misconfigured gateways/proxies rewriting envelopes; deserialization of legacy payloads with stale ChaincodeId fields.","solutions":["Rebuild the transaction envelope so the proposal header chaincodeId matches the chaincode that produced the response payload.","Never reuse or mutate serialized ChaincodeAction payloads across transactions.","Verify endorser/SDK versions align so ChaincodeId is serialized consistently.","If seen on-chain from an untrusted client, treat the tx as invalid and investigate the submitter."],"exampleFix":"// before: header names ccA, payload from ccB\nhdrExt.ChaincodeId.Name = \"ccA\"; respPayload.ChaincodeId.Name = \"ccB\";\n// after\nhdrExt.ChaincodeId.Name = \"mycc\"; respPayload.ChaincodeId.Name = \"mycc\";","handlingStrategy":"validation","validationCode":"if (hdrExt.chaincodeId.name !== respPayload.chaincodeId.name) { throw new Error(`ccid mismatch: ${hdrExt.chaincodeId.name} vs ${respPayload.chaincodeId.name}`); }","typeGuard":"function idsMatch(hdrExt, respPayload) { return !!hdrExt?.chaincodeId?.name && hdrExt.chaincodeId.name === respPayload?.chaincodeId?.name; }","tryCatchPattern":"try { validate(tx); } catch (err) { if (/inconsistent ccid info/.test(err.message)) { /* rebuild envelope; reject tx */ } else { throw err; } }","preventionTips":["Never reuse respPayload bytes across transactions.","Build envelopes only via the standard SDK/endorser flow.","Reject any client tooling that mutates serialized payloads.","Audit signed proposals for header/payload ID equality before endorsing."],"tags":["hyperledger-fabric","validation","chaincode","tampering"],"backgroundTag":"inconsistent-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"}