pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix buffer overflow when parsing SCRAM verifiers in backend
Date: Mon, 17 Jun 2019 12:49:23 +0000
Message-ID: <E1hcr4d-0005JQ-7L@gemulon.postgresql.org> (raw)

Fix buffer overflow when parsing SCRAM verifiers in backend

Any authenticated user can overflow a stack-based buffer by changing the
user's own password to a purpose-crafted value.  This often suffices to
execute arbitrary code as the PostgreSQL operating system account.

This fix is contributed by multiple folks, based on an initial analysis
from Tom Lane.  This issue has been introduced by 68e61ee, so it was
possible to make use of it at authentication time.  It became more
easily to trigger after ccae190 which has made the SCRAM parsing more
strict when changing a password, in the case where the client passes
down a verifier already hashed using SCRAM.  Back-patch to v10 where
SCRAM has been introduced.

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/09ec55b933091cb5b0af99978718cb3d289c71b6

Modified Files
--------------
src/backend/libpq/auth-scram.c         | 35 ++++++++++++++++++++++++++--------
src/test/regress/expected/password.out | 23 ++++++++++++++++++++++
src/test/regress/sql/password.sql      | 18 +++++++++++++++++
3 files changed, 68 insertions(+), 8 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1hcr4d-0005JQ-7L@gemulon.postgresql.org>
Permalink:  ../E1hcr4d-0005JQ-7L@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hcr4d-0005JQ-7L@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Fix buffer overflow when parsing SCRAM verifiers in backend
  In-Reply-To: <E1hcr4d-0005JQ-7L@gemulon.postgresql.org>
  References: <E1hcr4d-0005JQ-7L@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox