{"record":{"id":"cf5ec5b9e1f5cea7","repo":"kgretzky/evilginx2","slug":"invalid-version-format-must-be-x-y-z","errorCode":null,"errorMessage":"invalid version format (must be X.Y.Z)","messagePattern":"invalid version format \\(must be X\\.Y\\.Z\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/phishlet.go","lineNumber":1082,"sourceCode":"\tcv, err := p.parseVersion(cver)\n\tif err != nil {\n\t\treturn false\n\t}\n\n\tif pv.major > cv.major {\n\t\treturn true\n\t}\n\tif pv.major == cv.major && pv.minor >= cv.minor {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (p *Phishlet) parseVersion(ver string) (PhishletVersion, error) {\n\tret := PhishletVersion{}\n\tva := strings.Split(ver, \".\")\n\tif len(va) != 3 {\n\t\treturn ret, fmt.Errorf(\"invalid version format (must be X.Y.Z)\")\n\t}\n\tvar err error\n\tret.major, err = strconv.Atoi(va[0])\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\tret.minor, err = strconv.Atoi(va[1])\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\tret.build, err = strconv.Atoi(va[2])\n\tif err != nil {\n\t\treturn ret, err\n\t}\n\treturn ret, nil\n}\n\nfunc (p *Phishlet) paramVal(s string) string {","sourceCodeStart":1064,"sourceCodeEnd":1100,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/phishlet.go#L1064-L1100","documentation":"parseVersion parses a phishlet version string into a PhishletVersion struct (major/minor/patch). It throws this error when the version string does not split into exactly 3 dot-separated components, since phishlet files must declare a version in strict X.Y.Z semver-like form.","triggerScenarios":"A phishlet YAML file declares a version field with a malformed value — e.g. '2', '1.2', '1.2.3.4', an empty string, or trailing/leading dots — and the phishlet is loaded/parsed via parseVersion.","commonSituations":"Hand-editing a phishlet and writing 'version: 1.2' instead of 'version: 1.2.0'; copying an older phishlet from a previous release that used a different version scheme; typos like a missing digit or an extra dot.","solutions":["Edit the phishlet's version field to a valid three-part form, e.g. '1.2.0'","Count the dot-separated segments: must be exactly 3 non-empty integers","Obtain an updated phishlet from upstream that uses the X.Y.Z format","Wrap strconv.Atoi failures separately if version components are non-numeric (that produces a different error)"],"exampleFix":"# before (phishlet yaml)\nversion: '1.2'\n# after\nversion: '1.2.0'","handlingStrategy":"validation","validationCode":"func validPhishletVersion(v string) bool {\n\tparts := strings.Split(v, \".\")\n\tif len(parts) != 3 { return false }\n\tfor _, p := range parts {\n\t\tif _, err := strconv.Atoi(p); err != nil { return false }\n\t}\n\treturn true\n}","typeGuard":null,"tryCatchPattern":"v, err := p.parseVersion(ver)\nif err != nil {\n\treturn fmt.Errorf(\"phishlet %s: bad version %q: use X.Y.Z\", name, ver)\n}","preventionTips":["Always write phishlet versions as three integers: 1.2.0","Lint phishlet YAMLs in CI with a version regex like ^\\d+\\.\\d+\\.\\d+$","Pin phishlets to a repo revision so format drift is caught in review"],"tags":["phishlet","version-parsing","validation"],"backgroundTag":"invalid-version-format","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"}