{"record":{"id":"03126ef80ebb6cfb","repo":"hyperledger/fabric","slug":"name-s-for-config-id-is-not-allowed","errorCode":null,"errorMessage":"name '%s' for config ID is not allowed","messagePattern":"name '(.+?)' for config ID is not allowed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/configtx/validator.go","lineNumber":59,"sourceCode":"}\n\n// validateConfigID makes sure that the config element names (ie map key of\n// ConfigGroup) comply with the following restrictions\n//  1. Contain only ASCII alphanumerics, dots '.', dashes '-'\n//  2. Are shorter than 250 characters.\n//  3. Are not the strings \".\" or \"..\".\nfunc validateConfigID(configID string) error {\n\tre, _ := regexp.Compile(configAllowedChars)\n\t// Length\n\tif len(configID) <= 0 {\n\t\treturn errors.New(\"config ID illegal, cannot be empty\")\n\t}\n\tif len(configID) > MaxLength {\n\t\treturn errors.Errorf(\"config ID illegal, cannot be longer than %d\", MaxLength)\n\t}\n\t// Illegal name\n\tif _, ok := illegalNames[configID]; ok {\n\t\treturn errors.Errorf(\"name '%s' for config ID is not allowed\", configID)\n\t}\n\t// Illegal characters\n\tmatched := re.FindString(configID)\n\tif len(matched) != len(configID) {\n\t\treturn errors.Errorf(\"config ID '%s' contains illegal characters\", configID)\n\t}\n\n\treturn nil\n}\n\n// ValidateChannelID makes sure that proposed channel IDs comply with the\n// following restrictions:\n//  1. Contain only lower case ASCII alphanumerics, dots '.', and dashes '-'\n//  2. Are shorter than 250 characters.\n//  3. Start with a letter\n//\n// This is the intersection of the Kafka restrictions and CouchDB restrictions\n// with the following exception: '.' is converted to '_' in the CouchDB naming","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/configtx/validator.go#L41-L77","documentation":"validateConfigID rejects identifiers that are in the illegalNames set (reserved names such as \".\" and \"..\"). Reserved strings would be ambiguous or dangerous in config path traversal, so they are explicitly disallowed.","triggerScenarios":"Using \".\", \"..\", or another reserved name as a config group/value/policy key in a ConfigUpdate or new channel config.","commonSituations":"Relative-path-style keys leaking into config generation code; template-driven config builders emitting default placeholder names; users copying filesystem path segments into config IDs.","solutions":["Replace the reserved name with an explicit, unique identifier","Sanitize generated names against the illegalNames set before use","Review the config generation code to ensure path segments are not passed through unfiltered","Use configtxlator to decode and inspect the submitted config to locate the bad key"],"exampleFix":"// before\nname := path.Base(dir) // can be \".\" or \"..\"\ngroup.Groups[name] = &cb.ConfigGroup{}\n// after\nname := path.Base(dir)\nif name == \".\" || name == \"..\" {\n    return errors.Errorf(\"reserved name %q not allowed as config ID\", name)\n}","handlingStrategy":"validation","validationCode":"var reserved = map[string]bool{\".\": true, \"..\": true}\nif reserved[configID] {\n    return errors.Errorf(\"reserved name %q not allowed\", configID)\n}","typeGuard":"func notReservedName(id string) bool {\n    return id != \".\" && id != \"..\"\n}","tryCatchPattern":"if err := validateName(id); err != nil {\n    return fmt.Errorf(\"config name rejected: %w\", err)\n}","preventionTips":["Never pass raw path segments (path.Base output) as config IDs","Filter reserved names at config-generation time","Review templates for placeholder defaults like \".\"","Sanitize all externally sourced names before insertion into config"],"tags":["go","fabric","config","validation","naming"],"backgroundTag":"invalid-config-value","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"}