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 1l9c1G-0003CP-AK for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Feb 2021 23:02:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l9c1D-0006J1-V2 for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Feb 2021 23:02:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9c1D-0006IH-Gm for pgsql-hackers@lists.postgresql.org; Tue, 09 Feb 2021 23:02:03 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l9c1B-0004C2-El for pgsql-hackers@lists.postgresql.org; Tue, 09 Feb 2021 23:02:03 +0000 Received: by mail-pf1-x431.google.com with SMTP id u143so16381pfc.7 for ; Tue, 09 Feb 2021 15:02:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=sNoaZBB5P4bO79gnO7iGhyrRkEKQuA9QhK83Sj02JRM=; b=XuC4mwMXxjKn4idVICJyifFPbtU6XXMy0+nWV50flQMzGBQR4mNPZpv3BOH0w5gUsI LccD+NzoUO1+LuMNcZwPGmrWB7xxqm5VJFPAGxF7LV32+zwf1WqWR+5M0yPKg1cmrMig 18AOIFqNzYup1QSFUV+dqduLreYoK0B0AxULs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=sNoaZBB5P4bO79gnO7iGhyrRkEKQuA9QhK83Sj02JRM=; b=AXTFkYNr/66rVjvGyWtDbc54H9SdEvhfVk0XMe6fFc9LY8ucXO5dsqwupyCKpAv4ky YdFWQg0OW4Cq3o66gRR4LwHSlkTtNgfeEx2fEZognqCFiyyZDzoX0kXN4K6H9CdRgKTf Jx6iytDxak3u3o607X6qcrhOBiStkNEb2FpEa0mYRmYCwWErZhIJbubWxB8SUToRlqcY BLLTBsl7le4TcR5wx1vYk/8MZQtymFjuOPp6U0EOs+n+ckTgyDPMs5a+jeT0MiDmvYwJ fLAzl/EY0zCyaB3+/a1nSWx8tlstT3XyJcrgWtO3M44eksOSLwzfck1bifGTens5u1ZF U7Zw== X-Gm-Message-State: AOAM533SzOwILpeEX1XEkH9ZCCHQ3nLYm04Y76UxuJuEr6Hc5QJe8E0z OXrxRxDsxH1101SIPLp/RPXrUg== X-Google-Smtp-Source: ABdhPJxTzUm1QrFYyOwqpJd3lJChFpXbwaj1Wiv/EyAwlLGrDcnRWOpEhfaU8n5voDN3QhF8/wC1Ag== X-Received: by 2002:aa7:9e07:0:b029:1e2:6a31:66ee with SMTP id y7-20020aa79e070000b02901e26a3166eemr266623pfq.67.1612911719152; Tue, 09 Feb 2021 15:01:59 -0800 (PST) Received: from rfd.leadboat.com ([2600:1702:a20:5750::46]) by smtp.gmail.com with ESMTPSA id o189sm5080pfd.73.2021.02.09.15.01.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Feb 2021 15:01:58 -0800 (PST) Date: Tue, 9 Feb 2021 15:01:55 -0800 From: Noah Misch To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Tightening up allowed custom GUC names Message-ID: <20210209230155.GA551305@rfd.leadboat.com> References: <951335.1612910077@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <951335.1612910077@sss.pgh.pa.us> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Feb 09, 2021 at 05:34:37PM -0500, Tom Lane wrote: > Now granting that the best answer is just to forbid these cases, > there are still a couple of decisions about how extensive the > prohibition ought to be: > > * We could forbid these characters only when you try to actually > put such a GUC into pg_db_role_setting, and otherwise allow them. > That seems like a weird nonorthogonal choice though, so I'd > rather just forbid them period. Agreed. > * A case could be made for tightening things up a lot more, and not > allowing anything that doesn't look like an identifier. I'm not > pushing for that, as it seems more likely to break existing > applications than the narrow restriction proposed here. But I could > live with it if people prefer that way. I'd prefer that. Characters like backslash, space, and double quote have significant potential to reveal bugs, while having negligible application beyond revealing bugs.