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.98.2) (envelope-from ) id 1xAWm1-00000002hSd-3vcP for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Sep 2026 18:05:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xAWm0-00000004sPF-3sz8 for pgsql-hackers@arkaria.postgresql.org; Sat, 26 Sep 2026 18:05:20 +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.98.2) (envelope-from ) id 1xAWm0-00000004sP6-2cZd for pgsql-hackers@lists.postgresql.org; Sat, 26 Sep 2026 18:05:20 +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.98.2) (envelope-from ) id 1xAWly-00000001Qr0-2A74 for pgsql-hackers@lists.postgresql.org; Sat, 26 Sep 2026 18:05:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 68QI56CA079318; Sat, 26 Sep 2026 14:05:06 -0400 From: Tom Lane To: Noah Misch cc: Richard Guo , Thom Brown , Jacob Brazeal , pgsql-hackers@lists.postgresql.org, underdog@theori.io Subject: Re: remove_useless_joins vs. bug #19560 In-reply-to: <20260926174457.13.noahmisch@microsoft.com> References: <839346.1787765112@sss.pgh.pa.us> <954541.1787846010@sss.pgh.pa.us> <1147476.1787924590@sss.pgh.pa.us> <598915.1789613519@sss.pgh.pa.us> <20260926174457.13.noahmisch@microsoft.com> Comments: In-reply-to Noah Misch message dated "Sat, 26 Sep 2026 10:44:57 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <79316.1790445906.1@sss.pgh.pa.us> Date: Sat, 26 Sep 2026 14:05:06 -0400 Message-ID: <79317.1790445906@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Noah Misch writes: > security@ received a report about a regression in commit 2ebf25e. On > 2026-09-12, I told the reporter that we handle defects in unreleased code as > non-vulnerabilities and asked them to report it to pgsql-hackers. I didn't > find that report, so I'm forwarding it here. > ... > The new SJE implementation groups the RTEs by physical relation OID without > comparing their security qualifiers or permission identities. Right. I think the appropriate fix is probably to require that the checkAsUser values match in RTEs we want to combine. If we do that, I'm not sure that we need to consider securityQuals as such (but I've not tried it so maybe I'm missing something). The code 2ebf25e7d removed doesn't appear to have any particular consideration for either checkAsUser or securityQuals, so I wonder how it worked before. regards, tom lane