{"record":{"id":"733241245fd2d88b","repo":"kgretzky/evilginx2","slug":"missing-auth-tokens-section","errorCode":null,"errorMessage":"missing `auth_tokens` section","messagePattern":"missing `auth_tokens` section","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/phishlet.go","lineNumber":381,"sourceCode":"\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 {\n\t\tif ph.PhishSub == nil {\n\t\t\treturn fmt.Errorf(\"proxy_hosts: missing `phish_sub` field\")\n\t\t}","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/phishlet.go#L363-L399","documentation":"Same validation pass as the proxy_hosts check: the parser requires the `auth_tokens` section to exist. A nil AuthTokens section means no cookie/token capture rules are defined, so the phishlet is rejected. It is raised immediately after the proxy_hosts check in LoadPhishlet.","triggerScenarios":"Loading a phishlet YAML missing the top-level `auth_tokens:` key — either omitted, commented out, misspelled (e.g. `auth_token:`), or mis-indented so it unmarshals as nil even though other sections pass.","commonSituations":"Minimal/hand-made phishlets that include proxy_hosts and credentials but skip auth_tokens, or YAML indentation errors silently dropping the section (note: an empty `auth_tokens: []` list is fine — the key must exist).","solutions":["Add an `auth_tokens` section to the phishlet (use `auth_tokens: []` if truly none needed)","Fix spelling to exactly `auth_tokens` and ensure it is a top-level key","Check indentation so the section isn't nested under another key","Copy the section layout from an official phishlet in phishlets/ as a template"],"exampleFix":"# before\ncredentials:\n  username: {...}\n# after (add missing section)\nauth_tokens:\n  - domain: '.example.com'\n    keys: ['SessionID', 'session']\ncredentials:\n  username: {...}","handlingStrategy":"validation","validationCode":"doc := map[string]interface{}{}\nyaml.Unmarshal(data, &doc)\nif _, ok := doc[\"auth_tokens\"]; !ok {\n    return fmt.Errorf(\"phishlet must define auth_tokens (use [] if empty)\")\n}","typeGuard":"func hasAuthTokens(fp *ConfigPhishlet) bool {\n    return fp.AuthTokens != nil\n}","tryCatchPattern":"if err := cfg.LoadPhishlet(name, path, nil); err != nil {\n    if strings.Contains(err.Error(), \"missing `auth_tokens`\") {\n        log.Error(\"add an auth_tokens section (auth_tokens: [] suffices) to %s\", path)\n    }\n}","preventionTips":["Always include auth_tokens even if the list is empty — the key must exist","Verify the key spelling: auth_tokens (plural), top-level","Diff hand-edited phishlets against an official one to spot dropped sections","Validate with a YAML linter after every manual edit"],"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"}