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 1mJAHS-0002aj-4b for pgsql-general@arkaria.postgresql.org; Thu, 26 Aug 2021 07:58:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJAHP-000499-T7 for pgsql-general@arkaria.postgresql.org; Thu, 26 Aug 2021 07:58:31 +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 1mJAHP-00048z-6d for pgsql-general@lists.postgresql.org; Thu, 26 Aug 2021 07:58:31 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJAHH-0007Hg-JA for pgsql-general@lists.postgresql.org; Thu, 26 Aug 2021 07:58:29 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 8F3B63200927; Thu, 26 Aug 2021 03:58:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 26 Aug 2021 03:58:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=gBeAXE2uyzT26QbNr8iRsL0jo2QCc8oxXyB3UI0hN Gk=; b=JOuio0b9b/tIy5O++UJajXy0UidN+/2aOYtfKGhsEByB62YEz1jPZ1imA 1MkXHgjjAwSrdqaLMpvX7By4sdq2FEc/982SOyAs2v5uVh0+E4r/FYWifEaAj5Ov XVCF9v8QjDjVIAEM1WLOzDnaWCE5D+zyVJtpbWphMynngHxN3q60cXBBD7p75ENG AV+JjPBVtJKfDPCdd0Jp/NzccycX4+aanlP6z5fX+f+S9irl6IQPrPe+iG2fNNB1 nmp3ebAIy0FbHt5/WZKE1BZFt/9qMrtRjHNctDS4sb6gOlcZRLex0RoA1MDyAZQv 3ADMsD3pcMq72I1G1dMAzEx24CBWw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddutddguddviecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnth gvrhhprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeekheeihedvgeeugefh ffeuleeivdfgiefghfehvedvgeefgfefteegjedujeejheenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghu thesvghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Aug 2021 03:58:17 -0400 (EDT) Subject: Re: lower() and unaccent() not leakproof To: "David G. Johnston" , Christophe Pettus Cc: "pgsql-generallists.postgresql.org" References: <02BDFCCF-BDBB-4658-9717-4D95F9A91561@thebuild.com> From: Peter Eisentraut Message-ID: Date: Thu, 26 Aug 2021 09:58:13 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 you are partially correct.  Its due to the fact that error > messages, regardless of the root cause, result in the printing of the > input value in the error message as context, thus exists a leak via a > violation of “ It reveals no information about its arguments other than > by its return value. ” 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.