Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iwtDI-00031C-5Q for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Jan 2020 19:41:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iwtDG-0001Lv-CF for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Jan 2020 19:41:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iwtDF-0001HB-O0 for pgsql-hackers@lists.postgresql.org; Wed, 29 Jan 2020 19:41:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iwtDC-0006gV-FP for pgsql-hackers@lists.postgresql.org; Wed, 29 Jan 2020 19:41:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 00TJfG9K032316 for ; Wed, 29 Jan 2020 14:41:17 -0500 From: Tom Lane To: pgsql-hackers@lists.postgresql.org Subject: Marking some contrib modules as trusted extensions MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32314.1580326876.1@sss.pgh.pa.us> Date: Wed, 29 Jan 2020 14:41:16 -0500 Message-ID: <32315.1580326876@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Now that we're just about there on the patch to invent trusted extensions [1], I'd like to start a discussion about whether to mark anything besides the trusted PLs as trusted. I think generally we ought to mark contrib modules as trusted if it's sane to do so; there's not much point in handing people plperl (even sandboxed) but not, say, hstore. I trawled through what's in contrib today and broke things down like this: Certainly NO, as these allow external or low-level access: adminpack dblink file_fdw postgres_fdw pageinspect pg_buffercache pg_freespacemap pg_visibility pgstattuple Probably NO, if only because you'd need additional privileges to use these anyway: amcheck dict_xsyn hstore_plperlu hstore_plpython2u hstore_plpython3u hstore_plpythonu jsonb_plperlu jsonb_plpython2u jsonb_plpython3u jsonb_plpythonu ltree_plpython2u ltree_plpython3u ltree_plpythonu pg_prewarm pg_stat_statements Definitely candidates to mark trusted: citext cube dict_int (unlike dict_xsyn, this needs no external file) earthdistance (marginal usefulness though) fuzzystrmatch hstore hstore_plperl intagg (marginal usefulness though) intarray isn jsonb_plperl lo ltree pg_trgm pgcrypto seg tablefunc tcn tsm_system_rows tsm_system_time unaccent (needs external file, but the default one is useful) uuid-ossp Not sure what I think about these: bloom (are these useful in production?) btree_gin btree_gist pgrowlocks (seems safe, but are there security issues?) spi/autoinc (I doubt that these four are production grade) spi/insert_username spi/moddatetime spi/refint sslinfo (seems safe, but are there security issues?) xml2 (nominally safe, but deprecated, and libxml2 has been a fertile source of security issues) Any opinions about these, particularly the on-the-edge cases? Also, how should we document this, if we do it? Add a boilerplate sentence to each module's description about whether it is trusted or not? Put a table up at the front of Appendxix F? Both? I'm happy to go make this happen, once we have consensus on what should happen. regards, tom lane [1] https://www.postgresql.org/message-id/flat/5889.1566415762%40sss.pgh.pa.us