Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYfja-0005Ny-94 for pgsql-general@arkaria.postgresql.org; Thu, 15 Sep 2022 03:40:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oYfjY-0001lO-Ti for pgsql-general@arkaria.postgresql.org; Thu, 15 Sep 2022 03:40:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYfjY-0001lE-JM for pgsql-general@lists.postgresql.org; Thu, 15 Sep 2022 03:40:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYfjW-0005J3-8K for pgsql-general@lists.postgresql.org; Thu, 15 Sep 2022 03:40:11 +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 28F3e8br3100448; Wed, 14 Sep 2022 23:40:08 -0400 From: Tom Lane To: Mladen Gogala cc: Bryn Llewellyn , pgsql-general@lists.postgresql.org Subject: Re: Is it possible to stop sessions killing eachother when they all authorize as the same role? In-reply-to: <2bc1d63b-5376-bd25-4592-d86b77e4a4b8@gmail.com> References: <10F360BB-3149-45E6-BFFE-10B9AE31F1A6@yugabyte.com> <2bc1d63b-5376-bd25-4592-d86b77e4a4b8@gmail.com> Comments: In-reply-to Mladen Gogala message dated "Wed, 14 Sep 2022 21:57:11 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <3100446.1663213208.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 14 Sep 2022 23:40:08 -0400 Message-ID: <3100447.1663213208@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Mladen Gogala writes: > ... This doesn't look like a big problem because = > applications usually don't contain code for killing other user's = > sessions. I am not sure that GTA is running on top of Postgres database. Yeah, I meant to comment on that further but forgot. I don't particularly buy the premise that it's useful to prohibit a session belonging to user X from killing another session belonging to user X. In the end, the main point of a database is to store your data. Therefore, if you don't trust another session that is running as your userID, you have already lost. That session can drop your tables, or corrupt the data in those tables to an arbitrary extent, and the SQL permissions system will not squawk even feebly. Under any reasonable understanding of the goals of a DB, those consequences are far worse than killing a session. So if you're not happy with this hazard, you should not be accepting the idea that actors you don't trust are allowed to submit queries under the same userID as you. And if you're using a client-side software stack that forces that situation on you, it's time to look for another one. Or in other words, I flatly reject the claim that this: >>> It's common to design a three tier app so that the middle tier always = authorizes as just a single role=E2=80=94say, "client"=E2=80=94and where t= he operations that "client" can perform are limited as the overall design = specifies. is in any way sane or secure. There is not very much that the database server can do to clean up after insecure client-side stacks. regards, tom lane