Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tkdbG-005ZSb-HB for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Feb 2025 06:30:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tkdbD-004b1n-G4 for pgsql-bugs@arkaria.postgresql.org; Wed, 19 Feb 2025 06:30:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tkdbD-004b1c-7q for pgsql-bugs@lists.postgresql.org; Wed, 19 Feb 2025 06:30:23 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tkdbB-001i8l-0z for pgsql-bugs@lists.postgresql.org; Wed, 19 Feb 2025 06:30:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 51J6UIcY1951017; Wed, 19 Feb 2025 01:30:18 -0500 From: Tom Lane To: Matthias Apitz cc: Indrajeeth Deshmukh , David Rowley , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18817: Security Bug Report: Plaintext Password Exposure in Logs In-reply-to: References: <18817-771682052a364bfe@postgresql.org> <1241094.1739893072@sss.pgh.pa.us> Comments: In-reply-to Matthias Apitz message dated "Wed, 19 Feb 2025 06:57:52 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1951015.1739946618.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 19 Feb 2025 01:30:18 -0500 Message-ID: <1951016.1739946618@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Matthias Apitz writes: > What do I have to configure in the PostgreSQL server to get this > reproduced? I tried: [ scratches head... ] Seems like you must be looking in the wrong log file. It works for me: $ psql postgres psql (18devel) Type "help" for help. postgres=3D# set log_statement =3D 'all'; SET postgres=3D# CREATE USER bla WITH PASSWORD 'bla'; CREATE ROLE postgres=3D# \q $ tail .../postmaster.log ... 2025-02-19 01:19:18.638 EST [1949443] LOG: statement: CREATE USER bla WIT= H PASSWORD 'bla'; If you're not running with log_statement =3D all, the most likely scenario is a syntax error: $ psql postgres psql (18devel) Type "help" for help. postgres=3D# CREATE USER bla WITH PASWORD 'bla'; ERROR: unrecognized role option "pasword" LINE 1: CREATE USER bla WITH PASWORD 'bla'; ^ postgres=3D# \q $ tail .../postmaster.log ... 2025-02-19 01:25:39.227 EST [1950440] ERROR: unrecognized role option "pa= sword" at character 22 2025-02-19 01:25:39.227 EST [1950440] STATEMENT: CREATE USER bla WITH PAS= WORD 'bla'; Of course, this command didn't do anything; but a person reading the log would have a pretty strong clue what password you were about to assign. (And contrarily, Postgres itself would have no clue that 'bla' might be something that needs hiding.) regards, tom lane