Fix buffer overflow when processing SCRAM final message in libpq

Michael Paquier <michael@paquier.xyz>

Commit: 27c464e42a9e3cb3779d1ea63b835a3e191682d6
Author: Michael Paquier <michael@paquier.xyz>
Date: 2019-06-17T13:14:04Z
Releases: 11.4
Fix buffer overflow when processing SCRAM final message in libpq

When a client connects to a rogue server sending specifically-crafted
messages, this can suffice to execute arbitrary code as the operating
system account used by the client.

While on it, fix one error handling when decoding an incorrect salt
included in the first message received from server.

Author: Michael Paquier
Reviewed-by: Jonathan Katz, Heikki Linnakangas
Security: CVE-2019-10164
Backpatch-through: 10

Files

PathChange+/−
src/interfaces/libpq/fe-auth-scram.c modified +20 −1