{"record":{"id":"1ccadfec0bd2d30e","repo":"projectdiscovery/nuclei","slug":"invalid-matcher-type-s","errorCode":null,"errorMessage":"Invalid matcher type: %s","messagePattern":"Invalid matcher type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/operators/matchers/matchers_types.go","lineNumber":65,"sourceCode":"}\n\n// GetSupportedMatcherTypes returns list of supported types\nfunc GetSupportedMatcherTypes() []MatcherType {\n\tvar result []MatcherType\n\tfor index := MatcherType(1); index < limit; index++ {\n\t\tresult = append(result, index)\n\t}\n\treturn result\n}\n\nfunc toMatcherTypes(valueToMap string) (MatcherType, error) {\n\tnormalizedValue := normalizeValue(valueToMap)\n\tfor key, currentValue := range MatcherTypes {\n\t\tif normalizedValue == currentValue {\n\t\t\treturn key, nil\n\t\t}\n\t}\n\treturn -1, errors.New(\"Invalid matcher type: \" + valueToMap)\n}\n\nfunc normalizeValue(value string) string {\n\treturn strings.TrimSpace(strings.ToLower(value))\n}\n\nfunc (t MatcherType) String() string {\n\treturn MatcherTypes[t]\n}\n\n// MatcherTypeHolder is used to hold internal type of the matcher\ntype MatcherTypeHolder struct {\n\tMatcherType MatcherType `mapping:\"true\"`\n}\n\nfunc (t MatcherTypeHolder) String() string {\n\treturn t.MatcherType.String()\n}","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/operators/matchers/matchers_types.go#L47-L83","documentation":"Raised by toMatcherTypes when a template matcher's type field, after TrimSpace + ToLower, matches none of MatcherTypes. Supported matcher types are: status, size, word, regex, binary, dsl, xpath (matchers_types.go:34-42). MatcherTypeHolder.UnmarshalYAML propagates the error, aborting template compilation at load time.","triggerScenarios":"A matcher with type: header, type: body, or type: status-code; any value outside the seven-word enum.","commonSituations":"Intuitive but unsupported names ('header', 'body', 'favicon'); templates ported from other tools; condition words ('and', 'or') pasted into the type slot.","solutions":["Use one of: status, size, word, regex, binary, dsl, xpath","Match headers with type: word plus part: header; match body text with type: word plus part: body","Run nuclei -validate on the template before scanning"],"exampleFix":"# before\nmatchers:\n  - type: header\n    header:\n      - 'X-Powered-By: Express'\n# after\nmatchers:\n  - type: word\n    part: header\n    words:\n      - 'X-Powered-By: Express'","handlingStrategy":"validation","validationCode":"var validMatcherTypes = map[string]bool{\"status\": true, \"size\": true, \"word\": true, \"regex\": true, \"binary\": true, \"dsl\": true, \"xpath\": true}\nfunc matcherTypeOK(s string) bool { return validMatcherTypes[strings.ToLower(strings.TrimSpace(s))] }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Lint templates for the seven matcher types","Remember 'part: header/body' composes with word/regex instead of dedicated types"],"tags":["template","matchers","yaml","validation"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}