{"record":{"id":"92a430258d262a5d","repo":"kgretzky/evilginx2","slug":"force-post-missing-or-empty-force-field","errorCode":null,"errorMessage":"force_post: missing or empty `force` field","messagePattern":"force_post: missing or empty `force` field","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/phishlet.go","lineNumber":706,"sourceCode":"\t\t\tif o.tp == \"\" {\n\t\t\t\to.tp = \"post\"\n\t\t\t}\n\t\t\to.key_s = p.paramVal(*cp.Key)\n\t\t\tp.custom = append(p.custom, o)\n\t\t}\n\t}\n\n\tif fp.ForcePosts != nil {\n\t\tfor _, op := range *fp.ForcePosts {\n\t\t\tvar err error\n\t\t\tif op.Path == nil || *op.Path == \"\" {\n\t\t\t\treturn fmt.Errorf(\"force_post: missing or empty `path` field\")\n\t\t\t}\n\t\t\tif op.Type == nil || *op.Type != \"post\" {\n\t\t\t\treturn fmt.Errorf(\"force_post: unknown type - only 'post' is currently supported\")\n\t\t\t}\n\t\t\tif op.Force == nil || len(*op.Force) == 0 {\n\t\t\t\treturn fmt.Errorf(\"force_post: missing or empty `force` field\")\n\t\t\t}\n\n\t\t\tfpf := ForcePost{}\n\t\t\tfpf.path, err = regexp.Compile(p.paramVal(*op.Path))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfpf.tp = *op.Type\n\n\t\t\tif op.Search != nil {\n\t\t\t\tfor _, op_s := range *op.Search {\n\t\t\t\t\tif op_s.Key == nil {\n\t\t\t\t\t\treturn fmt.Errorf(\"force_post: missing search `key` field\")\n\t\t\t\t\t}\n\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","sourceCodeStart":688,"sourceCodeEnd":724,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/phishlet.go#L688-L724","documentation":"Thrown when a `force_post` operation has no `force` list, or its `force` list is empty. The `force` array defines the key/value pairs that will be substituted into intercepted POST bodies, so an operation without it would do nothing and is rejected during validation.","triggerScenarios":"Phishlet YAML contains a force_post entry where the `force:` key is absent, or present with no items (e.g. `force: []` or an empty indented block).","commonSituations":"Incomplete phishlet templates; deleting force entries while debugging without removing the parent operation; YAML mis-indentation that moves `force` items out of the list; converting examples that used a different schema.","solutions":["Add at least one `force` item with `key` and `value` under each force_post operation","Remove the whole force_post operation if forcing values is not actually needed","Fix indentation so `key`/`value` pairs are nested under `force:`"],"exampleFix":"# before\nforce_post:\n  - path: '/login'\n    type: post\n    force: []\n# after\nforce_post:\n  - path: '/login'\n    type: post\n    force:\n      - key: password\n        value: '{password}'","handlingStrategy":"validation","validationCode":"for i, op := range forcePosts {\n    if op.Force == nil || len(*op.Force) == 0 {\n        return fmt.Errorf(\"force_post[%d]: `force` list requires at least one {key,value} item\", i)\n    }\n}","typeGuard":"func hasForceItems(op ForcePostOp) bool { return op.Force != nil && len(*op.Force) > 0 }","tryCatchPattern":null,"preventionTips":["Give every force_post operation at least one force item","Delete the entire operation if you have nothing to force","Check YAML indentation so force items stay nested under `force:`","Diff your phishlet against a known-good example after edits"],"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-14T00:17:10.932Z"}