{"record":{"id":"902497b0b1096049","repo":"kgretzky/evilginx2","slug":"missing-proxy-hosts-section","errorCode":null,"errorMessage":"missing `proxy_hosts` section","messagePattern":"missing `proxy_hosts` section","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/phishlet.go","lineNumber":378,"sourceCode":"\t\t\t\t\tval = *param.Default\n\t\t\t\t}\n\n\t\t\t\tp.customParams[param.Name] = val\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t\tif customParams != nil {\n\t\t\t\tp.customParams = *customParams\n\t\t\t} else {\n\t\t\t\tfor _, param := range *fp.Params {\n\t\t\t\t\tp.customParams[param.Name] = param.Default\n\t\t\t\t}\n\t\t\t}*/\n\t}\n\n\tif fp.ProxyHosts == nil {\n\t\treturn fmt.Errorf(\"missing `proxy_hosts` section\")\n\t}\n\tif fp.AuthTokens == nil {\n\t\treturn fmt.Errorf(\"missing `auth_tokens` section\")\n\t}\n\tif fp.Credentials == nil {\n\t\treturn fmt.Errorf(\"missing `credentials` section\")\n\t}\n\tif fp.Credentials.Username == nil {\n\t\treturn fmt.Errorf(\"credentials: missing `username` section\")\n\t}\n\tif fp.Credentials.Password == nil {\n\t\treturn fmt.Errorf(\"credentials: missing `password` section\")\n\t}\n\tif fp.LoginItem == nil {\n\t\treturn fmt.Errorf(\"missing `login` section\")\n\t}\n\n\tfor _, ph := range *fp.ProxyHosts {","sourceCodeStart":360,"sourceCodeEnd":396,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/phishlet.go#L360-L396","documentation":"The phishlet parser validates the decoded ConfigPhishlet structure and requires the `proxy_hosts` section to be present. A nil ProxyHosts means the phishlet defines no host forwarding rules, making it unusable, so loading fails with this validation error.","triggerScenarios":"Loading a phishlet YAML that has no top-level `proxy_hosts:` key (or it is commented out / misspelled, e.g. `proxy_host:`), so fp.ProxyHosts is nil after unmarshal.","commonSituations":"Hand-writing a phishlet from scratch and forgetting the section, deleting proxy_hosts while pruning a phishlet, or YAML indentation making the section parse as a child of another key (thus nil).","solutions":["Add a `proxy_hosts` section with at least one entry to the phishlet YAML","Fix the key spelling to exactly `proxy_hosts`","Verify YAML indentation so proxy_hosts is a top-level key, not nested under another section","Compare against a known-good phishlet example from the repo's phishlets/ directory"],"exampleFix":"# before\nauth_tokens: []\n# after (add missing section)\nproxy_hosts:\n  - phish_sub: ''\n    orig_sub: 'www'\n    domain: 'example.com'\n    session: true\nauth_tokens: []","handlingStrategy":"validation","validationCode":"// quick YAML lint before loading\nfor _, section := range []string{\"proxy_hosts\", \"auth_tokens\", \"credentials\"} {\n    if _, ok := doc[section]; !ok {\n        return fmt.Errorf(\"phishlet missing section: %s\", section)\n    }\n}","typeGuard":"func hasProxyHosts(fp *ConfigPhishlet) bool {\n    return fp.ProxyHosts != nil\n}","tryCatchPattern":"if err := cfg.LoadPhishlet(name, path, nil); err != nil {\n    if strings.Contains(err.Error(), \"missing `proxy_hosts`\") {\n        log.Error(\"add a proxy_hosts section to %s\", path)\n    }\n}","preventionTips":["Start every phishlet from an official template in phishlets/","Keep proxy_hosts, auth_tokens, credentials as top-level keys at column 0","Lint YAML indentation with a parser before importing a hand-edited phishlet","Never comment out or rename required sections when pruning phishlets"],"tags":["phishlet","configuration","schema-validation","missing-section"],"backgroundTag":"missing-required-section","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"}