Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdyyg-0008S4-TF for pgsql-general@arkaria.postgresql.org; Thu, 20 Jun 2019 15:27:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hdyye-0004rB-O6 for pgsql-general@arkaria.postgresql.org; Thu, 20 Jun 2019 15:27:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdyye-0004pU-8c; Thu, 20 Jun 2019 15:27:52 +0000 Received: from mout.gmx.net ([212.227.17.21]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdyya-0007ud-D3; Thu, 20 Jun 2019 15:27:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561044462; bh=HizL+2jiGOQrIsm9u2hjyJQ+LqaJAJMVuQJhfOC3M3s=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=GVD4q1sphyjHUC/qVpfoFJ7DnbJZkYxnJ98YaY3H8VN0RZr4NOMeDm5KktrWQB5qF wUA1dw/etphelH5B9eMWEDk/qb2gYspW2FxqFbPywTrw7GfJTN9oGr8WAWJhMEiXgN 9KxenYXLUIKsJciuPdHBiqPQOOHnXizCQhXrqpAM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hermes ([77.183.153.192]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MfYPY-1iFGfW22RM-00fx27; Thu, 20 Jun 2019 17:27:42 +0200 Received: from ncq by hermes with local (Exim 4.92) (envelope-from ) id 1hdyyT-0004WT-J4; Thu, 20 Jun 2019 17:27:41 +0200 Date: Thu, 20 Jun 2019 17:27:41 +0200 From: Karsten Hilbert To: pgsql-general@lists.postgresql.org, pgsql-general@postgresql.org Subject: Re: Row data is reflected in DETAIL message when constraints fail on insert/update Message-ID: <20190620152741.GG30366@hermes.hilbert.loc> Mail-Followup-To: pgsql-general@lists.postgresql.org, pgsql-general@postgresql.org References: <20190620114527.GD30366@hermes.hilbert.loc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Ma_X_il-Followup-to: d Re_X_turn-receipt-to: Karsten.Hilbert@gmx.net Di_X_sposition-Notification-To: Karsten.Hilbert@gmx.net X-Confi_X_rm-Reading-To: Karsten.Hilbert@gmx.net X-Pri_X_ority: 2 (High) User-Agent: Mutt/1.10.1 (2018-07-13) Sender: X-Provags-ID: V03:K1:JKPRT32+ipIXX7CrIyab2r0sz2Zeh+jxClac1pO5uyHmz1nFvON plTVUkxZ8EUz34fcHsEv1t2zXWyPcj7uXpTVTSVj68bwvMY/Fg0tUBkAzHG77JW3e+DKoFR 8zAjDhQzEFZf9KHz3t7wg0xal1vRLwPn7yN9ke2JWIbfMtk8hywgQNu4YqMe+aVtS5xKDn8 Qh1XcmXpfrYmJ43OVF8eQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:OBstR49rgRQ=:4b69NTiTcTOaAlFY8AzvhN pVbIl3krgHGM06MAxV/FfZjAkcgsQAWyAoCkaNl9+f1y/3zW8aoZQIz2Pz9zo4WYdshYgSpG6 NqnmJJ27cfnPAYF4/3wXyh1uPEUMjYattwSwxG4b08iOpfp2BSZgjbB1UP3DNmwzNlsrBCuLc XByuVAupk677LQeYRp9jeENQbBtW9GdvmAmp9uPueXBEmDS3zwH/Iq0CnVgAY41mYgBDAQGcX sqT5p/1bfhoHHm/5IgxtVVqfWOHklGbov7ru9BYjvf4IXq/gIaXtLrzP1jOvtS4SL3KowS6cF Cr7o6XFLRuVZ5J68HKZzBdiWCdK99KCQZk+euL3PLV8pRc4sBsHsndYZM4Hy6+ZP6ygnSxGB5 7eiV6p+8bejAY7O0mbpoleLt812H/caow/7z2d9KFCtoWls01L4QR//rsXE8wDoOj0ewhjpRH J8LWNKBYx557XK4MHHeu9mhUCi+I7/dI6jciC+puoXA+M9EZHT3K2LWio6e8jK3/lgwRM4Zva +It5ItFaGTpIkrc5zvVd9j2wjbnZuTZy6CNNOBgMNr8kTKr3Xh+oevEHVu67PmNyh6naa1PKL 8bhso9qwSNYds1EICGPzoEWlBSYzB//OkVtgqpPUwBzWOiN/sENsGEC1EGKEKzmAUGwpn3gD7 QKovce4W7Qkuena4MsNb5NtmTgnDogvyRGZ5lv9V86WtH15tz1ifRwkXehczZw804LczCFqHf 816DNXgocGV4PMuOSlloA2jxvyxwLflF/I7lTCxxdL3Lw3yZCco+yVIfmIKqdAX4c8bEBimYV jq9FZbgi8yG+l6K39weD3Ze3qoMGzL1e2ABA2ey4QMKeJXYqRrU3vjHEZ0G/dJJgBJ/BjtXgI Z996lW+if5f9mWXrqy0w4QxjP8BvK3FQWnPPf4iODud79LDzB14zC3oWB59QPmMRhtS5QqQe2 XX2ZS2ZROiLbWdvOr6gJetJ+uaDeBXh8= Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Jun 20, 2019 at 05:22:20PM +0200, Shay Rojansky wrote: > It seems generally agreed that all data from the database should be > considered potentially sensitive and should therefore not be leaked in l= og > messages - unless an explicit, informed opt-in is done. It is extremely > easy to imagine a (poorly-written) UI or web application which simply > surfaces database exceptions, allowing attackers to potentially extract > data from the database. In the worst case, passwords and other auth > information may get exposed in this way, but even any sort of personal > information is a big problem. > > It seems worth at least having a conversation about it... Sure, but we are currently exploring whether the database reflects any values that it had not been given by the same user beforehand. There might be another scenario: user enters value for column 1 app adds in secret-to-the-user value for column 2 UPDATE fails error message reflects val 1 and secret val 2 app displays both values user knows secret value 2 but I don't see how PostgreSQL can do anything *reasonable* about that short of sitting tight-and-mum and not reflect much of *anything* beyond "error". And even that can be a side channel. Karsten =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B