Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1c9b6e8

Browse files
committed
Verify that the server constructed the SCRAM nonce correctly.
The nonce consists of client and server nonces concatenated together. Theclient checks the nonce contained the client nonce, but it would get fooledif the server sent a truncated or even empty nonce.Reported by Steven Fackler to security@postgresql.org. Neither me or Stevenare sure what harm a malicious server could do with this, but let's fix it.
1 parentd951db2 commit1c9b6e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/interfaces/libpq/fe-auth-scram.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,8 @@ read_server_first_message(fe_scram_state *state, char *input,
430430
}
431431

432432
/* Verify immediately that the server used our part of the nonce */
433-
if (strncmp(nonce,state->client_nonce,strlen(state->client_nonce))!=0)
433+
if (strlen(nonce)<strlen(state->client_nonce)||
434+
memcmp(nonce,state->client_nonce,strlen(state->client_nonce))!=0)
434435
{
435436
printfPQExpBuffer(errormessage,
436437
libpq_gettext("invalid SCRAM response (nonce mismatch)\n"));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp