NationalSecurityAgency/ghidra · error · LSHException
Bad characters in proposed category type
Error message
Bad characters in proposed category type
What it means
fdbInstallCategory validates query.type_name with enforceTypeCharacters; if it fails (null/empty or a disallowed character) it throws LSHException("Bad characters in proposed category type") before writing anything to configuration.
Source
Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java:2919
}
if (!names.add(name)) {
throw new LSHException("Duplicate " + type + " entry specified: " + name);
}
}
}
/**
* Entry point for the InstallCategoryRequest command:
* Install a new executable category to be managed by the database
* @param query is command parameters
* @throws LSHException if the command is misconfigured
* @throws ElasticException for communication problems with the server
*/
private void fdbInstallCategory(InstallCategoryRequest query)
throws LSHException, ElasticException {
ResponseInfo response = query.installresponse;
if (!CategoryRecord.enforceTypeCharacters(query.type_name)) {
throw new LSHException("Bad characters in proposed category type");
}
if (query.isdatecolumn) {
info.dateColumnName = query.type_name;
StringBuilder buffer = new StringBuilder();
buffer.append("{ \"type\": \"keyvalue\", \"value\": \"")
.append(info.dateColumnName)
.append("\" }");
connection.executeStatementNoResponse(ElasticConnection.PUT, "configuration/datecolumn",
buffer.toString());
response.info = info;
return;
}
// Check for existing category
if (info.execats != null) {
for (String cat : info.execats) {
if (cat.equals(query.type_name)) {
throw new LSHException("Executable category already exists");
}View on GitHub (pinned to d5f144c24d)
Solutions
- Sanitize type_name to the allowed character set before issuing the request.
- Reject null/empty upstream and surface a clear form/CLI error.
Example fix
// before req.type_name = raw; // 'my-category' // after req.type_name = sanitizeCategory(raw); // 'my_category'
Defensive patterns
Strategy: validation
Validate before calling
if (!CategoryRecord.enforceTypeCharacters(req.type_name))
throw new IllegalArgumentException("Invalid category name: " + req.type_name); Type guard
boolean validCategory = CategoryRecord.enforceTypeCharacters(name);
Prevention
- Validate names in the InstallCategoryRequest builder before submit.
- Reuse one sanitize() helper for all category/tag names.
When it happens
Trigger: An InstallCategoryRequest whose type_name is None, empty, or contains characters outside the allowed set (alphanumeric, space, . _ : / ( )).
Common situations: Category name derived from a path/symbol with disallowed punctuation; empty value from a missing CLI arg; trailing newline.
Related errors
- Bad characters in one or more proposed {type}
- Bad characters in proposed category type
- Bad characters in proposed function tag
- Bad category tag
- Bad characters in one or more proposed ${type}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/4b7f2a386e045e3a.
Report an issue: GitHub.