Skip to content

Commit 8515612

Browse files
timopollmeiergreenbonebot
authored andcommitted
Forbid empty password in authentication
The `authenticate_any_method` function now rejects any authentication attempts with a missing or empty password. This prevents authentication bypass issues in cases where insecure authentication servers skip the password check if the password is empty.
1 parent ac80871 commit 8515612

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/manage_sql.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5250,6 +5250,12 @@ authenticate_any_method (const gchar *username, const gchar *password,
52505250
gchar *hash;
52515251
gboolean use_cache = TRUE;
52525252

5253+
if (password == NULL || *password == '\0')
5254+
{
5255+
g_debug ("%s: Empty password rejected", __func__);
5256+
return 1;
5257+
}
5258+
52535259
sql_begin_immediate ();
52545260

52555261
ret = sql_table_lock_wait ("auth_cache", 30000);

0 commit comments

Comments
 (0)