Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f4tnk-0005d7-27 for pgsql-general@arkaria.postgresql.org; Sat, 07 Apr 2018 19:47:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f4tni-0001pO-DM for pgsql-general@arkaria.postgresql.org; Sat, 07 Apr 2018 19:47:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f4tng-0001pE-Lr for pgsql-general@lists.postgresql.org; Sat, 07 Apr 2018 19:47:02 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f4tnb-0006aF-Bi for pgsql-general@postgresql.org; Sat, 07 Apr 2018 19:46:59 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D7BD220E19; Sat, 7 Apr 2018 15:46:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sat, 07 Apr 2018 15:46:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=4MPktad8J/JUysJzXsRO3WnhPo8Zb 4KyNTRLqY5V4yk=; b=cba4yslw4ysnfoFr7+TzZWmTRTGlG3Z553s7TtOpvOGVd nU2dUYTQw4GcTDahOt0ihgvUbQY7zu4palJ3bJpLMvOPEWhnGKMANDQWVfCqA2wq RPbqzwQf7W1DajCiZDJHI8vNmf1FNg6vgI4TpCshB8U4NwzVXp0RYaEgc7GCMG+A KIRp1xOVbMbrxV6iF6rfoWkt+coPsVa+5epm4korKr/S4ciG/SpMzQnQ/lu1p/Zr BhIKI4ZJRXhTnJ1/GFMx5oXsbG4gH1aw+F9y6jVaY+d5AUsrL6uB+VdIv1iXLXNv aVsQSZTin5Z2SEA/KovzKeolU4jU97Hzzz9dbUN4A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=4MPkta d8J/JUysJzXsRO3WnhPo8Zb4KyNTRLqY5V4yk=; b=kzii0MOhogAuJ+CGEfLKeJ KeU8phILsNyS4I+xRX7K3Ou8Kq85msRa0yTBGhJ3dgKkukEc2tqHgknSFqARPzZE ycnY+qsQ6hzmwtWECPN8dbapJSZR71r8PfEzVakx6sypfU4VBtJ07uuUpaSvJLWZ R+RkHaE9GtrwhdAE5KGJyerRrNaVZQfAfYG6ss8dPi/7sYLt2FJvwMCr8u+PWf0Y yM8WxCtgciRTwtiQ4yYsNwTnayvx2u/OZB4TmQgDiKGi+iVYzpUgI1ZaFU7dbssI k+gOTmk7GudpJ7fP+lVcBTyGddfrX4vacxrDj79rpVxK2BrPY2f/ddWVNurqPwBw == X-ME-Sender: Received: from [192.168.1.2] (71-35-123-124.tukw.qwest.net [71.35.123.124]) by mail.messagingengine.com (Postfix) with ESMTPA id 58FE21025B; Sat, 7 Apr 2018 15:46:53 -0400 (EDT) Subject: Re: dump/restore problem due to CVE-2018-1058 (9.5.12) To: Rory Campbell-Lange , pgsql-general@postgresql.org References: <20180407192757.utugzd2zbwbtwoui@campbell-lange.net> From: Adrian Klaver Message-ID: Date: Sat, 7 Apr 2018 12:46:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180407192757.utugzd2zbwbtwoui@campbell-lange.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 04/07/2018 12:27 PM, Rory Campbell-Lange wrote: > Hi > > Following an upgrade to 9.5.12, we cannot restore some of our databases > due to a schema qualification issue introduced in the new postgres > version of pg_dump. > > Specifically, the problem line is the addition of : > > SELECT pg_catalog.set_config('search_path', '', false); > > to the header of the pg_dump output. > > As a result, pg_restore now fails because we have some table constraints > that use functions which do not use public schema qualified table/column > references. > > (I'm aware that the reasons behind the change made to the dump format > due to CVE-2018-1058 are set out here: > https://wiki.postgresql.org/wiki/A_Guide_to_CVE-2018-1058:_Protect_Your_Search_Path) > > Additionally we sometimes use search_path manipulations + > temporary_schema.function to test functions in production environments. > Having to qualify the schema of objects seems a retrogressive step, but > perhaps our usage is peculiar in this way. AFAIK you can still do that or did I miss something? > > Also, in a coding environment where object.attribute masking is a > feature of the language, as it is in python, this change seems obtuse. > My function in schema x can still mask a function in another schema y, > so the problem of function masking (if it is a problem) still exists. Are talking Python external or internal to Postgres? If internal, then plpythonu is an untrusted language and can only be used by a superuser. If you are a superuser then there is host of other things you could do to compromise security as well. > > Thanks for any comments. > > Regards > Rory > > -- Adrian Klaver adrian.klaver@aklaver.com