{"record":{"id":"089ae0da7be81da1","repo":"projectdiscovery/nuclei","slug":"s-is-not-a-valid-severity","errorCode":null,"errorMessage":"'%s' is not a valid severity","messagePattern":"'(.+?)' is not a valid severity","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/types/severity/severities.go","lineNumber":90,"sourceCode":"\tvar stringSeverities = make([]string, 0, len(severities))\n\tfor _, severity := range severities {\n\t\tstringSeverities = append(stringSeverities, severity.String())\n\t}\n\treturn strings.Join(stringSeverities, \", \")\n}\n\nfunc (severities Severities) MarshalJSON() ([]byte, error) {\n\tvar stringSeverities = make([]string, 0, len(severities))\n\tfor _, severity := range severities {\n\t\tstringSeverities = append(stringSeverities, severity.String())\n\t}\n\treturn json.Marshal(stringSeverities)\n}\n\nfunc setSeverity(severities *Severities, value string) error {\n\tcomputedSeverity, err := toSeverity(value)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"'%s' is not a valid severity\", value)\n\t}\n\n\t// TODO change the Severities type to map[Severity]interface{}, where the values are struct{}{}, to \"simulates\" a \"set\" data structure\n\t*severities = append(*severities, computedSeverity)\n\treturn nil\n}\n","sourceCodeStart":72,"sourceCodeEnd":97,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/model/types/severity/severities.go#L72-L97","documentation":"Returned by setSeverity in nuclei' severity model when toSeverity cannot map a string to a known severity level. Severities is parsed from both CLI flags (-severity / -s) and template JSON via UnmarshalJSON/Set, and every value must be one of the supported levels (info, low, medium, high, critical, unknown); anything else aborts parsing with the offending value echoed back.","triggerScenarios":"A template with info.severity: 'informational' or 'moderate' instead of the accepted keywords; a typo like 'critcial' or 'meduim'; CLI usage like -severity high,criticals; extra whitespace/case variants that the parser does not normalize.","commonSituations":"Hand-edited or third-party templates with non-standard severity labels; older templates predating severity normalization; CI pipelines passing a custom severity list via flags where one element is misspelled.","solutions":["Fix the value to one of: info, low, medium, high, critical, unknown (write severity values lowercase in templates)","Validate templates with nuclei's template validation (-tl / template-validate) before running them","When passing -severity on the CLI, double-check each comma-separated element against the accepted set"],"exampleFix":"# before (template)\ninfo:\n  severity: informational\n\n# after\ninfo:\n  severity: info","handlingStrategy":"validation","validationCode":"package main\n\nimport \"strings\"\n\nvar validSeverities = map[string]bool{\"info\": true, \"low\": true, \"medium\": true, \"high\": true, \"critical\": true, \"unknown\": true}\n\nfunc severityValid(s string) bool { return validSeverities[strings.ToLower(strings.TrimSpace(s))] }","typeGuard":"func severityValid(s string) bool { return validSeverities[strings.ToLower(strings.TrimSpace(s))] }","tryCatchPattern":null,"preventionTips":["Restrict severity fields to the canonical set: info, low, medium, high, critical, unknown","Run template linting (-tl) in CI before execution","Validate user-supplied -severity flag values against the same set"],"tags":["nuclei","template","severity","yaml","validation"],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}