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 1ryect-00HMG4-R0 for pgsql-general@arkaria.postgresql.org; Sun, 21 Apr 2024 21:21:31 +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 1ryecs-00GFnz-Dj for pgsql-general@arkaria.postgresql.org; Sun, 21 Apr 2024 21:21:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ryecs-00GFnr-2n for pgsql-general@lists.postgresql.org; Sun, 21 Apr 2024 21:21:30 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ryecl-003yJ5-Fb for pgsql-general@lists.postgresql.org; Sun, 21 Apr 2024 21:21:28 +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 43LLLKMG2858913; Sun, 21 Apr 2024 17:21:20 -0400 From: Tom Lane To: Adrian Klaver cc: yudhi s , "David G. Johnston" , pgsql-general Subject: Re: error in trigger creation In-reply-to: <73f0e7a2-b958-4a95-96d8-08e08909c9c1@aklaver.com> References: <2720974.1713710606@sss.pgh.pa.us> <73f0e7a2-b958-4a95-96d8-08e08909c9c1@aklaver.com> Comments: In-reply-to Adrian Klaver message dated "Sun, 21 Apr 2024 13:53:05 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2858911.1713734480.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sun, 21 Apr 2024 17:21:20 -0400 Message-ID: <2858912.1713734480@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Klaver writes: > On 4/21/24 11:20, yudhi s wrote: >> So in this case i was wondering if "event trigger" can cause any >> additional threat and thus there is no such privilege like "create >> trigger" exist in postgres and so it should be treated cautiously? > An event trigger runs as a superuser and executes a function that in > turn can do many things, you do the math on the threat level. As a trivial example: an event trigger could prevent the legitimate superuser(s) from doing anything at all in that database, just by blocking all their commands. This might not even require malicious intent, merely faulty coding --- but the opportunity for malicious intent is staggeringly large. regards, tom lane