kgretzky/evilginx2 · error

invalid version format (must be X.Y.Z)

Error message

invalid version format (must be X.Y.Z)

What it means

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.

Source

Thrown at core/phishlet.go:1082

	cv, err := p.parseVersion(cver)
	if err != nil {
		return false
	}

	if pv.major > cv.major {
		return true
	}
	if pv.major == cv.major && pv.minor >= cv.minor {
		return true
	}
	return false
}

func (p *Phishlet) parseVersion(ver string) (PhishletVersion, error) {
	ret := PhishletVersion{}
	va := strings.Split(ver, ".")
	if len(va) != 3 {
		return ret, fmt.Errorf("invalid version format (must be X.Y.Z)")
	}
	var err error
	ret.major, err = strconv.Atoi(va[0])
	if err != nil {
		return ret, err
	}
	ret.minor, err = strconv.Atoi(va[1])
	if err != nil {
		return ret, err
	}
	ret.build, err = strconv.Atoi(va[2])
	if err != nil {
		return ret, err
	}
	return ret, nil
}

func (p *Phishlet) paramVal(s string) string {

View on GitHub (pinned to 4c0988a1d9)

Solutions

  1. Edit the phishlet's version field to a valid three-part form, e.g. '1.2.0'
  2. Count the dot-separated segments: must be exactly 3 non-empty integers
  3. Obtain an updated phishlet from upstream that uses the X.Y.Z format
  4. Wrap strconv.Atoi failures separately if version components are non-numeric (that produces a different error)

Example fix

# before (phishlet yaml)
version: '1.2'
# after
version: '1.2.0'
Defensive patterns

Strategy: validation

Validate before calling

func validPhishletVersion(v string) bool {
	parts := strings.Split(v, ".")
	if len(parts) != 3 { return false }
	for _, p := range parts {
		if _, err := strconv.Atoi(p); err != nil { return false }
	}
	return true
}

Try / catch

v, err := p.parseVersion(ver)
if err != nil {
	return fmt.Errorf("phishlet %s: bad version %q: use X.Y.Z", name, ver)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of kgretzky/evilginx2@4c0988a1d9 (2026-09-05). Data as JSON: /api/errors/cf5ec5b9e1f5cea7. Report an issue: GitHub.