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

Commit71c3779

Browse files
committed
Properly NULL-terminate GSS receive buffer on error packet reception
pqsecure_open_gss() includes a code path handling error messages withv2-style protocol messages coming from the server. The client-sidebuffer holding the error message does not force a NULL-termination, withthe data of the server getting copied to the errorMessage of theconnection. Hence, it would be possible for a server to send anunterminated string and copy arbitrary bytes in the buffer receiving theerror message in the client, opening the door to a crash or even dataexposure.As at this stage of the authentication process the exchange has not beencompleted yet, this could be abused by an attacker without Kerberoscredentials. Clients that have a valid kerberos cache are vulnerable aslibpq opportunistically requests for it except if gssencmode isdisabled.Author: Jacob ChampionBackpatch-through: 12Security:CVE-2022-41862
1 parent2f6e15a commit71c3779

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎src/interfaces/libpq/fe-secure-gssapi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,8 @@ pqsecure_open_gss(PGconn *conn)
573573

574574
PqGSSRecvLength+=ret;
575575

576+
Assert(PqGSSRecvLength<PQ_GSS_RECV_BUFFER_SIZE);
577+
PqGSSRecvBuffer[PqGSSRecvLength]='\0';
576578
appendPQExpBuffer(&conn->errorMessage,"%s\n",PqGSSRecvBuffer+1);
577579

578580
returnPGRES_POLLING_FAILED;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp