{"record":{"id":"1533fa1ab115fa04","repo":"kgretzky/evilginx2","slug":"intercept-missing-http-status-field","errorCode":null,"errorMessage":"intercept: missing `http_status` field","messagePattern":"intercept: missing `http_status` field","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/phishlet.go","lineNumber":507,"sourceCode":"\tif fp.Intercept != nil {\n\t\tfor _, ic := range *fp.Intercept {\n\t\t\tvar err error\n\t\t\tvar body, mime string\n\t\t\tif ic.Domain == nil {\n\t\t\t\treturn fmt.Errorf(\"intercept: missing `domain` field\")\n\t\t\t}\n\t\t\tif *ic.Domain == \"\" {\n\t\t\t\treturn fmt.Errorf(\"intercept: `domain` field cannot be empty\")\n\t\t\t}\n\t\t\tif ic.Path == nil {\n\t\t\t\treturn fmt.Errorf(\"intercept: missing `path` field\")\n\t\t\t}\n\t\t\tpath_re, err := regexp.Compile(*ic.Path)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"intercept: `path` invalid regular expression: %v\", err)\n\t\t\t}\n\t\t\tif ic.HttpStatus == nil {\n\t\t\t\treturn fmt.Errorf(\"intercept: missing `http_status` field\")\n\t\t\t}\n\t\t\tif ic.Body != nil {\n\t\t\t\tbody = *ic.Body\n\t\t\t}\n\t\t\tif ic.Mime != nil {\n\t\t\t\tmime = *ic.Mime\n\t\t\t}\n\t\t\terr = p.addIntercept(*ic.Domain, path_re, *ic.HttpStatus, body, mime)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\tfor _, at := range *fp.AuthTokens {\n\t\tttype := \"cookie\"\n\t\tif at.Type != nil {\n\t\t\tttype = *at.Type\n\t\t}","sourceCodeStart":489,"sourceCodeEnd":525,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/phishlet.go#L489-L525","documentation":"This error is thrown when validating a phishlet's `intercept` block: `domain` and `path` are valid, but the required `http_status` field is missing. Each intercept entry must declare the HTTP status code to serve for matching responses. The phishlet fails to load until it is added.","triggerScenarios":"An intercept block defines `domain` and `path` but omits the `http_status` key, e.g. an entry with only `domain` and `path` lines.","commonSituations":"Partially completed phishlet; deleting the status line while editing; using an old phishlet format example that lacks this field.","solutions":["Add an `http_status` field with an integer status code to the intercept block (commonly `http_status: 302`).","Cross-check the intercept block against a working example phishlet to confirm all required fields (domain, path, http_status).","Ensure YAML indentation places `http_status` under the same list item as `domain` and `path`."],"exampleFix":"// before (phishlet.yml)\nintercept:\n  - domain: accounts\n    path: ^/login$\n// after\nintercept:\n  - domain: accounts\n    path: ^/login$\n    http_status: 302","handlingStrategy":"validation","validationCode":"for i, ic := range cfg.Intercept {\n    if ic.HttpStatus == nil {\n        return fmt.Errorf(\"intercept[%d]: missing `http_status` field\", i)\n    }\n}","typeGuard":"func hasHttpStatus(ic InterceptCfg) bool {\n    return ic.HttpStatus != nil && *ic.HttpStatus >= 100 && *ic.HttpStatus < 600\n}","tryCatchPattern":null,"preventionTips":["Always include http_status in intercept blocks (commonly 302 or 200).","Compare against a known-good example phishlet before loading.","Use an editor YAML schema that flags missing required keys."],"tags":["phishlet","configuration","yaml-validation"],"backgroundTag":"missing-required-argument","analyzedSha":"4c0988a1d9db4d172a185e979a38bfd0efdb5830","analyzedAt":"2026-09-05T19:23:07.238Z","contentChangedAt":"2026-09-05T19:23:07.238Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}