{"record":{"id":"19152c20342cec6c","repo":"kgretzky/evilginx2","slug":"intercept-domain-field-cannot-be-empty","errorCode":null,"errorMessage":"intercept: `domain` field cannot be empty","messagePattern":"intercept: `domain` field cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/phishlet.go","lineNumber":497,"sourceCode":"\t\t\t}\n\t\t\tfor n := range *js.TriggerPaths {\n\t\t\t\t(*js.TriggerPaths)[n] = p.paramVal((*js.TriggerPaths)[n])\n\t\t\t}\n\t\t\terr := p.addJsInject(*js.TriggerDomains, *js.TriggerPaths, js.TriggerParams, p.paramVal(*js.Script))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\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)","sourceCodeStart":479,"sourceCodeEnd":515,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/phishlet.go#L479-L515","documentation":"This error is thrown during phishlet YAML validation when an `intercept` configuration block defines a `domain` field that is present but set to an empty string. The library requires every intercept entry to declare the subdomain whose responses it applies to, so an empty value is rejected just like a missing one. It is raised by the phishlet parser in core/phishlet.go while compiling the phishlet config.","triggerScenarios":"A phishlet YAML contains an intercept block like `intercept:\\n  - domain: \"\"` — the `domain` key exists (pointer non-nil) but dereferences to \"\".","commonSituations":"Hand-editing a phishlet and clearing the domain value; templating/scripted generation that leaves the field blank; copying a phishlet and forgetting to fill in the target subdomain.","solutions":["Set a non-empty subdomain value in the intercept block's `domain` field (e.g. `domain: accounts`).","If the intercept should match any subdomain, use the wildcard value supported by the phishlet format instead of leaving it blank.","Remove the whole intercept block if it is not needed."],"exampleFix":"// before (phishlet.yml)\nintercept:\n  - domain: \"\"\n    path: ^/login$\n// after\nintercept:\n  - domain: \"accounts\"\n    path: ^/login$","handlingStrategy":"validation","validationCode":"for i, ic := range cfg.Intercept {\n    if ic.Domain == nil {\n        return fmt.Errorf(\"intercept[%d]: missing `domain` field\", i)\n    }\n    if *ic.Domain == \"\" {\n        return fmt.Errorf(\"intercept[%d]: `domain` field cannot be empty\", i)\n    }\n}","typeGuard":"func hasNonEmptyDomain(ic InterceptCfg) bool {\n    return ic.Domain != nil && strings.TrimSpace(*ic.Domain) != \"\"\n}","tryCatchPattern":null,"preventionTips":["Never leave a YAML key with an empty value — delete the key or fill it in.","Lint phishlet files with a schema validator before loading.","Fill in domain immediately after copying a phishlet template.","Run the phishlet through the loader in a test harness before deployment."],"tags":["phishlet","configuration","yaml-validation"],"backgroundTag":"phishlet-config-validation","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"}