{"record":{"id":"4e4681c69caa9a20","repo":"kgretzky/evilginx2","slug":"edit-redirect-url-must-be-absolute","errorCode":null,"errorMessage":"edit: redirect url must be absolute","messagePattern":"edit: redirect url must be absolute","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/terminal.go","lineNumber":959,"sourceCode":"\t\t\t\t\t\t\treturn fmt.Errorf(\"edit: %v\", err)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tl.Path = u.EscapedPath()\n\t\t\t\t\t\tif len(l.Path) == 0 || l.Path[0] != '/' {\n\t\t\t\t\t\t\tl.Path = \"/\" + l.Path\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tl.Path = \"/\"\n\t\t\t\t\t}\n\t\t\t\t\tdo_update = true\n\t\t\t\t\tlog.Info(\"path = '%s'\", l.Path)\n\t\t\t\tcase \"redirect_url\":\n\t\t\t\t\tif val != \"\" {\n\t\t\t\t\t\tu, err := url.Parse(val)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn fmt.Errorf(\"edit: %v\", err)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif !u.IsAbs() {\n\t\t\t\t\t\t\treturn fmt.Errorf(\"edit: redirect url must be absolute\")\n\t\t\t\t\t\t}\n\t\t\t\t\t\tl.RedirectUrl = u.String()\n\t\t\t\t\t} else {\n\t\t\t\t\t\tl.RedirectUrl = \"\"\n\t\t\t\t\t}\n\t\t\t\t\tdo_update = true\n\t\t\t\t\tlog.Info(\"redirect_url = '%s'\", l.RedirectUrl)\n\t\t\t\tcase \"phishlet\":\n\t\t\t\t\t_, err := t.cfg.GetPhishlet(val)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn fmt.Errorf(\"edit: %v\", err)\n\t\t\t\t\t}\n\t\t\t\t\tl.Phishlet = val\n\t\t\t\t\tdo_update = true\n\t\t\t\t\tlog.Info(\"phishlet = '%s'\", l.Phishlet)\n\t\t\t\tcase \"info\":\n\t\t\t\t\tl.Info = val\n\t\t\t\t\tdo_update = true","sourceCodeStart":941,"sourceCodeEnd":977,"githubUrl":"https://github.com/kgretzky/evilginx2/blob/4c0988a1d9db4d172a185e979a38bfd0efdb5830/core/terminal.go#L941-L977","documentation":"The `lures edit <id> redirect_url <val>` command in evilginx2 parses the given value with net/url.Parse and requires an absolute URL (u.IsAbs()). This error means the lure's redirect_url was set to a value without a scheme, e.g. 'example.com/path' instead of 'https://example.com/path'.","triggerScenarios":"Running `lures edit <id> redirect_url` with a value like 'example.com' or '/path' that url.Parse succeeds on but IsAbs() reports false (no scheme://host).","commonSituations":"Operators entering a bare domain as redirect target, copying a path-only URL, or forgetting https:// when configuring post-login redirects for a lure.","solutions":["Prefix the value with a scheme, e.g. `lures edit <id> redirect_url https://example.com`","Verify with `url.Parse` + `IsAbs()` before running the command","If the intent is to clear the redirect URL, pass an empty string instead"],"exampleFix":"// before\nlures edit 0 redirect_url accounts.google.com\n// after\nlures edit 0 redirect_url https://accounts.google.com","handlingStrategy":"validation","validationCode":"u, err := url.Parse(val)\nif err != nil || !u.IsAbs() {\n    return errors.New(\"redirect_url must be an absolute URL, e.g. https://example.com\")\n}","typeGuard":"func isAbsoluteURL(s string) bool {\n    u, err := url.Parse(s)\n    return err == nil && u.IsAbs()\n}","tryCatchPattern":"if _, err := url.Parse(val); err != nil {\n    return fmt.Errorf(\"edit: %v\", err)\n}\nif !u.IsAbs() {\n    return fmt.Errorf(\"edit: redirect url must be absolute\")\n}","preventionTips":["Always include scheme+host (https://...) in redirect_url values","Test the value with url.Parse and IsAbs before applying","Pass an empty string to clear the field rather than a relative path"],"tags":["cli","url-validation","evilginx2"],"backgroundTag":"invalid-url-format","analyzedSha":"4c0988a1d9db4d172a185e979a38bfd0efdb5830","analyzedAt":"2026-09-05T19:23:07.238Z","contentChangedAt":"2026-09-05T19:23:07.238Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}