NationalSecurityAgency/ghidra · error · LSHException

No password provided

Error message

No password provided

What it means

Thrown by PostgresFunctionDatabase.fdbPasswordChange() when the PasswordChange request's newPassword field is null or has length zero. A non-empty password is required to perform a password change; a null or empty array indicates the request is incomplete.

Source

Thrown at Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/PostgresFunctionDatabase.java:616

	/**
	 * Entry point for the PrewarmRequest command
	 * @param request the prewarm request
	 * @param c Postgres DB connection
	 * @throws SQLException if there is an error issuing the query
	 */
	private void fdbPrewarm(PrewarmRequest request, Connection c) throws SQLException {
		ResponsePrewarm response = request.prewarmresponse;
		response.blockCount = preWarm(c, request.mainIndexConfig, request.secondaryIndexConfig,
			request.vectorTableConfig);
	}

	private void fdbPasswordChange(PasswordChange query, Connection c) 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 {
			changePassword(c, query.username, query.newPassword);
		}
		catch (SQLException e) {
			response.changeSuccessful = false;
			response.errorMessage = e.getMessage();
		}
	}

	@Override
	public String formatBitAndSQL(String v1, String v2) {
		return "(" + v1 + " & " + v2 + ")";
	}

}

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Always set PasswordChange.newPassword to a non-empty char[] before submitting.
  2. Validate the password is non-empty client-side before calling doQuery().
  3. Ensure clearPassword() is called only after the request has been fully processed, not before submission.

Example fix

// before
PasswordChange q = new PasswordChange();
q.username = user;
q.newPassword = null; // or new char[0]
db.doQuery(q, conn); // throws "No password provided"

// after
if (newPass == null || newPass.isEmpty()) {
    throw new IllegalArgumentException("password required");
}
PasswordChange q = new PasswordChange();
q.username = user;
q.newPassword = newPass.toCharArray();
db.doQuery(q, conn);
q.clearPassword(); // zero out after use
Defensive patterns

Strategy: validation

Validate before calling

if (query.newPassword == null || query.newPassword.length == 0) {
    throw new IllegalArgumentException("new password must not be empty");
}
db.doQuery(query, conn);

Type guard

public static boolean isPasswordChangeValid(PasswordChange q) {
    return q.username != null && !q.username.isEmpty()
        && q.newPassword != null && q.newPassword.length > 0;
}

Try / catch

try {
    db.doQuery(query, conn);
} catch (LSHException e) {
    if (e.getMessage().contains("No password provided")) {
        // prompt for password, then retry
        throw e;
    }
    throw e;
}

Prevention

When it happens

Trigger: Submitting a PasswordChange query where newPassword is null or an empty char[]. This occurs when the caller constructs the request but does not set newPassword, sets it to null, or provides an empty password string. When parsing XML via restoreXml, an empty body element produces an empty char[].

Common situations: Client code omits setting newPassword. A UI form submitted an empty password field. The clearPassword() method was called prematurely, zeroing out the array before the request was processed. An XML request body was empty.

Related errors


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