{"record":{"id":"c0eba6df176ba0ff","repo":"kgretzky/evilginx2","slug":"auth-tokens-keys-not-found-for-cookie-auth-toke","errorCode":null,"errorMessage":"auth_tokens: 'keys' not found for cookie auth token","messagePattern":"auth_tokens: 'keys' not found for cookie auth token","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/phishlet.go","lineNumber":535,"sourceCode":"\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}\n\t\tif !stringExists(ttype, AUTH_TOKEN_TYPES) {\n\t\t\treturn fmt.Errorf(\"auth_tokens: invalid token type: %s\", ttype)\n\t\t}\n\t\tswitch ttype {\n\t\tcase \"cookie\":\n\t\t\tif at.Domain == nil {\n\t\t\t\treturn fmt.Errorf(\"auth_tokens: 'domain' not found for cookie auth token\")\n\t\t\t}\n\t\t\tif at.Keys == nil {\n\t\t\t\treturn fmt.Errorf(\"auth_tokens: 'keys' not found for cookie auth token\")\n\t\t\t}\n\n\t\t\tfor n := range *at.Keys {\n\t\t\t\t(*at.Keys)[n] = p.paramVal((*at.Keys)[n])\n\t\t\t}\n\t\t\terr := p.addCookieAuthTokens(p.paramVal(*at.Domain), *at.Keys)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase \"body\":\n\t\t\tif at.Domain == nil {\n\t\t\t\treturn fmt.Errorf(\"auth_tokens: 'domain' not found for body auth token\")\n\t\t\t}\n\t\t\tif at.Path == nil {\n\t\t\t\treturn fmt.Errorf(\"auth_tokens: 'path' not found for body auth token\")\n\t\t\t}\n\t\t\tif at.Name == nil {\n\t\t\t\treturn fmt.Errorf(\"auth_tokens: 'name' not found for body auth token\")","sourceCodeStart":517,"sourceCodeEnd":553,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/phishlet.go#L517-L553","documentation":"This error is thrown when a `cookie`-type entry in a phishlet's `auth_tokens` section defines a `domain` but omits the required `keys` field, the list of cookie names to capture as auth tokens. Without keys there is nothing to identify, so the entry is invalid and the phishlet fails to load.","triggerScenarios":"An auth_tokens entry with type cookie declares `domain: accounts` but has no `keys:` list.","commonSituations":"Incomplete entry after removing a keys list; editing keys out and leaving the entry stub; YAML indentation putting `keys` outside the list item.","solutions":["Add a `keys` list of cookie names to the cookie auth token entry (e.g. `keys: [auth_session, auth_token]`).","If no cookie names are known yet, remove or comment out the entry until they are identified from the target's login flow.","Confirm `keys` is a YAML list at the same indentation as `domain` within the same entry."],"exampleFix":"// before (phishlet.yml)\nauth_tokens:\n  - domain: accounts\n// after\nauth_tokens:\n  - domain: accounts\n    keys:\n      - auth_session\n      - auth_token","handlingStrategy":"validation","validationCode":"for i, at := range cfg.AuthTokens {\n    if at.Type != nil && *at.Type == \"cookie\" && at.Keys == nil {\n        return fmt.Errorf(\"auth_tokens[%d]: 'keys' not found for cookie auth token\", i)\n    }\n}","typeGuard":"func hasCookieKeys(at AuthToken) bool {\n    return at.Keys != nil && len(*at.Keys) > 0\n}","tryCatchPattern":null,"preventionTips":["Never submit an auth_tokens entry without its `keys` list.","Identify cookie names from the target's login flow before writing the entry.","Remove stub entries you cannot complete instead of leaving partial config."],"tags":["phishlet","configuration","auth-tokens","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"}