{"record":{"id":"69eca36c5e2be5e3","repo":"owasp-amass/amass","slug":"improper-mask-used-s","errorCode":null,"errorMessage":"improper mask used: %s","messagePattern":"improper mask used: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/wordlist.go","lineNumber":51,"sourceCode":"\t\treturn expanded, fmt.Errorf(\"exceeded maximum mask size (3): %s\", word)\n\t}\n\n\tparts := strings.SplitN(word, \"?\", 2)\n\tif len(parts) > 1 {\n\t\tif len(parts[1]) > 0 {\n\t\t\tswitch parts[1][0] {\n\t\t\tcase 'a':\n\t\t\t\tchars = maskLetters + maskDigits + maskSpecial\n\t\t\tcase 'd':\n\t\t\t\tchars = maskDigits\n\t\t\tcase 'u':\n\t\t\t\tfallthrough\n\t\t\tcase 'l':\n\t\t\t\tchars = maskLetters\n\t\t\tcase 's':\n\t\t\t\tchars = maskSpecial\n\t\t\tdefault:\n\t\t\t\treturn expanded, fmt.Errorf(\"improper mask used: %s\", word)\n\t\t\t}\n\t\t\tfor _, ch := range chars {\n\t\t\t\tnewWord := parts[0] + string(ch) + parts[1][1:]\n\t\t\t\tnextRound, err := ExpandMask(newWord)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn expanded, err\n\t\t\t\t}\n\t\t\t\texpanded = append(expanded, nextRound...)\n\t\t\t}\n\t\t}\n\t} else {\n\t\texpanded = append(expanded, word)\n\t}\n\treturn expanded, nil\n}\n\n// ExpandMaskWordlist performs ExpandMask on a slice of words.\nfunc ExpandMaskWordlist(wordlist []string) ([]string, error) {","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/wordlist.go#L33-L69","documentation":"ExpandMask only understands specific mask characters (e.g. 'u' upper, 'd' digit, 'l' letters, 's' special); anything else after '?' hits the default branch and returns this error. It signals that the mask placeholder syntax is not recognized by this implementation.","triggerScenarios":"Calling ExpandMask with an unsupported placeholder such as ?a, ?h, or ?1 that the hashcat-style subset in this library does not implement.","commonSituations":"Copying hashcat masks that use the full hashcat charset into this simpler expander; typos like ?L or ?d?; invalid characters in a wordlist entry intended as a mask.","solutions":["Use only the supported placeholders: u, d, l, s","Check config/wordlist.go for the exact maskLetters/maskSpecial/upper/digit sets","Pre-validate mask strings before expansion"],"exampleFix":"// before\nwords, err := ExpandMask(\"?a?d\")\n// after\nwords, err := ExpandMask(\"?s?d\")","handlingStrategy":"validation","validationCode":"var validPlaceholders = map[byte]bool{'u':true,'d':true,'l':true,'s':true}\nfunc isValidMaskSyntax(w string) bool {\n  for i := 0; i < len(w); i++ { if w[i] == '?' && i+1 < len(w) && !validPlaceholders[w[i+1]] { return false } }\n  return true\n}","typeGuard":"func isSupportedPlaceholder(c byte) bool { return c=='u'||c=='d'||c=='l'||c=='s' }\n","tryCatchPattern":"words, err := ExpandMask(m)\nif err != nil {\n  if strings.HasPrefix(err.Error(), \"improper mask used\") {\n    // report the unsupported placeholder and skip this entry\n  }\n  return err\n}","preventionTips":["Only use u/d/l/s placeholders; this is a subset of full hashcat syntax","Validate mask syntax before handing it to ExpandMask","Reject or log non-mask words containing '?' found in wordlists"],"tags":["wordlist","mask","invalid-argument"],"backgroundTag":"invalid-argument-format","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"}