NationalSecurityAgency/ghidra · error · LSHException

Missing username for password change

Error message

Missing username for password change

What it means

fdbPasswordChange requires query.username; if it is null it throws LSHException("Missing username for password change") (a subsequent check rejects a missing password). Nothing is sent to the server.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java:3420

		response.errorMessage = null;
		try {
			dropDatabase();
		}
		catch (ElasticException e) {
			response.dropSuccessful = false;
			response.errorMessage = e.getMessage();
		}
	}

	/**
	 * Entry point for the Elasticsearch version of PasswordChange command.
	 * @param query is command parameters
	 * @throws LSHException if details of the request are malformed
	 */
	private void fdbPasswordChange(PasswordChange query) throws LSHException {
		ResponsePassword response = query.passwordResponse;
		if (query.username == null) {
			throw new LSHException("Missing username for password change");
		}
		if (query.newPassword == null || query.newPassword.length == 0) {
			throw new LSHException("No password provided");
		}
		response.changeSuccessful = true;		// Response parameters assuming success
		response.errorMessage = null;
		try {
			changePasswordInternal(query.username, query.newPassword);
		}
		catch (ElasticException ex) {
			response.changeSuccessful = false;
			response.errorMessage = ex.getMessage();
		}
		query.clearPassword();
	}

	/**
	 * Given the document id for a specific function. Query for the document and

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Set username on the request before submitting.
  2. Validate request completeness client-side before issuing the command.

Example fix

// before
PasswordChange req = new PasswordChange();
req.newPassword = pw;            // username forgotten
// after
PasswordChange req = new PasswordChange();
req.username = requireUser();    // non-null
req.newPassword = pw;
Defensive patterns

Strategy: validation

Validate before calling

if (req.username == null || req.username.isBlank())
    throw new IllegalArgumentException("Password change requires a username");

Type guard

boolean hasUser = req.username != null && !req.username.isBlank();

Prevention

When it happens

Trigger: A PasswordChange request constructed without setting the username field.

Common situations: Programmatically building a PasswordChange and forgetting username; a CLI missing the --user argument.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/21b775df649273f3. Report an issue: GitHub.