{"record":{"id":"5bb6bcc93864afff","repo":"kgretzky/evilginx2","slug":"array-of-parameters-not-found","errorCode":null,"errorMessage":"array of parameters not found","messagePattern":"array of parameters not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/terminal.go","lineNumber":1659,"sourceCode":"\t\t\t\tfor r.More() {\n\t\t\t\t\tt, err := r.Token()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn ret, ret_params, err\n\t\t\t\t\t}\n\n\t\t\t\t\tif s, ok := t.(string); ok && s == \"{\" {\n\t\t\t\t\t\tfor r.More() {\n\t\t\t\t\t\t\tt, err := r.Token()\n\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\treturn ret, ret_params, err\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn ret, ret_params, fmt.Errorf(\"array of parameters not found\")\n\t\t\t}*/\n\t}\n\treturn ret, ret_params, nil\n}\n\nfunc (t *Terminal) exportPhishUrls(export_path string, phish_urls []string, phish_params []map[string]string, format string) error {\n\tif len(phish_urls) != len(phish_params) {\n\t\treturn fmt.Errorf(\"phishing urls and phishing parameters count do not match\")\n\t}\n\tif !stringExists(format, []string{\"text\", \"csv\", \"json\"}) {\n\t\treturn fmt.Errorf(\"export format can only be 'text', 'csv' or 'json'\")\n\t}\n\n\tf, err := os.OpenFile(export_path, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()","sourceCodeStart":1641,"sourceCodeEnd":1677,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/terminal.go#L1641-L1677","documentation":"This error is defined in importParamsFromFile but currently sits inside a commented-out JSON decoder block, so it is dead code in the present source: it was intended to signal that a JSON params file did not contain a top-level array of parameter objects. In the live code path, JSON files are parsed with json.Unmarshal and malformed input surfaces as a json library error instead. If you see this string at runtime you are running a build where the legacy decoder is active and the params file is not a JSON array.","triggerScenarios":"Historically/conditionally: calling the lure parameter import with format 'json' on a file whose root is an object or scalar rather than an array of objects (e.g. '{\"user\":\"x\"}' instead of '[{\"user\":\"x\"}]').","commonSituations":"Exporting params from another tool as a single JSON object, hand-editing the file and dropping the enclosing brackets, or reading docs for an older version whose decoder used streaming tokens.","solutions":["Ensure the JSON file's root is an array of objects: '[{\"k\":\"v\"}, ...]'.","Re-export the params file using this tool's own JSON format.","Note that in current code the error is unreachable; any JSON error you actually see comes from json.Unmarshal, so fix the JSON syntax reported there."],"exampleFix":"// before (params.json)\n{\"username\":\"victim\"}\n// after\n[{\"username\":\"victim\"}]","handlingStrategy":"validation","validationCode":"data, err := ioutil.ReadFile(paramsFile)\nif err != nil { return err }\nvar arr []map[string]interface{}\nif err := json.Unmarshal(data, &arr); err != nil {\n    return fmt.Errorf(\"params file must be a JSON array of objects: %v\", err)\n}\nif len(arr) == 0 {\n    return fmt.Errorf(\"params file contains no parameter objects\")\n}","typeGuard":"func isJSONArrayOfObjects(data []byte) bool {\n    var arr []map[string]interface{}\n    return json.Unmarshal(data, &arr) == nil\n}","tryCatchPattern":"urls, params, err := t.importParamsFromFile(path, base, format)\nif err != nil {\n    if strings.Contains(err.Error(), \"array of parameters not found\") || isJSONSyntaxErr(err) {\n        log.Printf(\"params file %s is not a JSON array of objects\", path)\n        return\n    }\n    return err\n}","preventionTips":["Always export params files with the tool's own JSON exporter","Validate JSON root is an array before importing","Diff hand-edited params files against a known-good export"],"tags":["json","file-import","dead-code"],"backgroundTag":"invalid-json-params-file","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"}