{"record":{"id":"8da8e860a6aa3279","repo":"owasp-amass/amass","slug":"failed-to-get-absolute-path-for-wordlist-file-w","errorCode":null,"errorMessage":"failed to get absolute path for wordlist file: %w","messagePattern":"failed to get absolute path for wordlist file: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/brute.go","lineNumber":48,"sourceCode":"\tif !c.BruteForcing {\n\t\treturn nil\n\t}\n\n\tif wordlistPathRaw, ok := bruteforce[\"wordlists\"]; ok {\n\t\twordlistPaths, ok := wordlistPathRaw.([]interface{})\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"bruteforce wordlist_file is not an array\")\n\t\t}\n\n\t\tfor _, wordlistPathRaw := range wordlistPaths {\n\t\t\twordlistPath, ok := wordlistPathRaw.(string)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"bruteforce wordlist_file item is not a string\")\n\t\t\t}\n\n\t\t\tabsPath, err := c.AbsPathFromConfigDir(wordlistPath)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to get absolute path for wordlist file: %w\", err)\n\t\t\t}\n\n\t\t\twordlist, err := GetListFromFile(absPath)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"unable to load the file in the bruteforce wordlist_file setting: %s: %v\", absPath, err)\n\t\t\t}\n\n\t\t\tc.Wordlist = append(c.Wordlist, wordlist...)\n\t\t}\n\t}\n\n\tc.Wordlist = stringset.Deduplicate(c.Wordlist)\n\treturn nil\n}\n\nfunc (c *Config) loadAlterationSettings(cfg *Config) error {\n\talterationsRaw, ok := c.Options[\"alterations\"]\n\tif !ok {","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/brute.go#L30-L66","documentation":"In loadBruteForceSettings, each wordlist path is resolved to an absolute path via Config.AbsPathFromConfigDir (relative paths are resolved against the config directory). When that call returns an error, it is wrapped with %w and prefixed with this message. It indicates the wordlist path could not be made absolute — typically because no config directory is set or the path cannot be evaluated from the stored location.","triggerScenarios":"Calling the config loader with a bruteforce.wordlists entry whose path resolution fails in AbsPathFromConfigDir — e.g. the config was loaded from a string/stdin with no config directory while the wordlist path is relative.","commonSituations":"Piping a config via stdin or -c - so no config dir exists, but wordlists use relative paths; config directory not initialized before loading; moving a config file to another machine where its recorded base path no longer applies.","solutions":["Use an absolute path in the wordlists entry: - /usr/share/wordlists/list.txt","Load the config from an actual file on disk so a config directory is available for relative resolution","Ensure Config.WithConfigDir (or equivalent) is called before loading settings","Verify the path syntax (no stray characters) and that it is a valid filesystem path"],"exampleFix":"// before\ncfg := &Config{}\ncfg.Options = map[string]interface{}{\"bruteforce\": map[string]interface{}{\"wordlists\": []interface{}{\"list.txt\"}}}\n\n// after\ncfg := &Config{}\ncfg.WithConfigDir(\"/home/user/.config/amass\") // so relative paths resolve\ncfg.Options = map[string]interface{}{\"bruteforce\": map[string]interface{}{\"wordlists\": []interface{}{\"/usr/share/wordlists/list.txt\"}}}","handlingStrategy":"validation","validationCode":"func ensureResolvableWordlistPath(path, configDir string) error {\n\tif filepath.IsAbs(path) {\n\t\treturn nil\n\t}\n\tif configDir == \"\" {\n\t\treturn fmt.Errorf(\"relative wordlist path %q requires a config directory\", path)\n\t}\n\treturn nil\n}","typeGuard":"func isAbsolutePath(p string) bool { return filepath.IsAbs(p) }","tryCatchPattern":"if err := cfg.LoadSettings(); err != nil {\n\tvar pathErr *fs.PathError\n\tif strings.Contains(err.Error(), \"failed to get absolute path for wordlist file\") {\n\t\t// switch to absolute paths or set a config dir, then retry\n\t}\n\t_ = pathErr\n\tlog.Fatal(err)\n}","preventionTips":["Prefer absolute wordlist paths in configs that may be loaded from stdin or moved between machines","Always load the config from a real file so a config directory exists for relative paths","Call the config-dir setter before loading settings when using relative paths","Test relative paths on the target machine before deployment"],"tags":["go","config","path","wordlist"],"backgroundTag":"file-not-found","analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}