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 1mJFvS-0005Tz-7K for pgsql-general@arkaria.postgresql.org; Thu, 26 Aug 2021 14:00: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 1mJFvR-0004Lo-4I for pgsql-general@arkaria.postgresql.org; Thu, 26 Aug 2021 14:00:13 +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 1mJFvQ-0004Ki-SP for pgsql-general@lists.postgresql.org; Thu, 26 Aug 2021 14:00: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 1mJFvK-0001dg-RA for pgsql-general@lists.postgresql.org; Thu, 26 Aug 2021 14:00: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 17QE01G5648382; Thu, 26 Aug 2021 10:00:01 -0400 From: Tom Lane To: Peter Eisentraut cc: "David G. Johnston" , Christophe Pettus , "pgsql-generallists.postgresql.org" Subject: Re: lower() and unaccent() not leakproof In-reply-to: References: <02BDFCCF-BDBB-4658-9717-4D95F9A91561@thebuild.com> Comments: In-reply-to Peter Eisentraut message dated "Thu, 26 Aug 2021 09:58:13 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <648380.1629986401.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Thu, 26 Aug 2021 10:00:01 -0400 Message-ID: <648381.1629986401@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > On 26.08.21 06:52, David G. Johnston wrote: >> On Wednesday, August 25, 2021, Christophe Pettus > > wrote: >>> lower() and unaccent() (and most string functions) are not marked as >>> leakproof.  Is this due to possible locale / character encoding >>> errors they might encounter? > I think if you trace the code, you might find that lower() and upper() > can't really leak anything. It might be worth taking a careful look and > possibly lifting this restriction. Generally speaking, we've been resistant to marking anything leakproof unless it has a very small code footprint that can be easily audited. In particular, anything that shares a lot of infrastructure with not-leakproof functions seems quite hazardous. Even if you go through the code and convince yourself that it's OK today, innocent changes to the shared infrastructure could break the leakproofness tomorrow. regards, tom lane