{"record":{"id":"3eb8f315affe30a1","repo":"kgretzky/evilginx2","slug":"force-post-missing-force-key-field","errorCode":null,"errorMessage":"force_post: missing force `key` field","messagePattern":"force_post: missing force `key` field","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/phishlet.go","lineNumber":739,"sourceCode":"\t\t\t\t\tif op_s.Search == nil {\n\t\t\t\t\t\treturn fmt.Errorf(\"force_post: missing search `search` field\")\n\t\t\t\t\t}\n\n\t\t\t\t\tf_s := ForcePostSearch{}\n\t\t\t\t\tf_s.key, err = regexp.Compile(p.paramVal(*op_s.Key))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tf_s.search, err = regexp.Compile(p.paramVal(*op_s.Search))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tfpf.search = append(fpf.search, f_s)\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor _, op_f := range *op.Force {\n\t\t\t\tif op_f.Key == nil {\n\t\t\t\t\treturn fmt.Errorf(\"force_post: missing force `key` field\")\n\t\t\t\t}\n\t\t\t\tif op_f.Value == nil {\n\t\t\t\t\treturn fmt.Errorf(\"force_post: missing force `value` field\")\n\t\t\t\t}\n\n\t\t\t\tf_f := ForcePostForce{\n\t\t\t\t\tkey:   p.paramVal(*op_f.Key),\n\t\t\t\t\tvalue: p.paramVal(*op_f.Value),\n\t\t\t\t}\n\t\t\t\tfpf.force = append(fpf.force, f_f)\n\t\t\t}\n\t\t\tp.forcePost = append(p.forcePost, fpf)\n\t\t}\n\t}\n\n\tif fp.LandingPath != nil {\n\t\tp.landing_path = *fp.LandingPath\n\t\tfor n := range p.landing_path {","sourceCodeStart":721,"sourceCodeEnd":757,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/phishlet.go#L721-L757","documentation":"Thrown when an entry inside a force_post operation's `force` list lacks the `key` field. Each force item must specify which POST body parameter to override (`key`) and the replacement (`value`); a missing key makes the forcing rule unaplicable, so validation rejects the phishlet.","triggerScenarios":"Phishlet YAML force_post entry contains `force:` items where `value:` is present but `key:` is missing; p.Validate() is called on the phishlet.","commonSituations":"Typos (`field:`, `name:` instead of `key:`); copy-paste from other directives with different naming; hand-merging force lists and dropping a key line; YAML anchors resolving to maps without `key`.","solutions":["Add `key:` to every item in the `force` list","Fix key-name typos to match the force schema (key + value)","Remove malformed force items that are not needed"],"exampleFix":"# before\nforce:\n  - value: '{password}'\n# after\nforce:\n  - key: 'password'\n    value: '{password}'","handlingStrategy":"validation","validationCode":"for _, op := range forcePosts {\n    if op.Force == nil { continue }\n    for j, f := range *op.Force {\n        if f.Key == nil {\n            return fmt.Errorf(\"force_post force[%d]: `key` is required\", j)\n        }\n    }\n}","typeGuard":"func forceHasKey(f ForcePostForceCfg) bool { return f.Key != nil }","tryCatchPattern":null,"preventionTips":["Every force item must have both `key` and `value`","Use consistent field names (key/value) when copying between phishlets","Check YAML merge keys/anchors resolve to complete maps","Run phishlet validation before enabling"],"tags":["phishlet","config-validation","force-post"],"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"}