Re: Fixes for missing schema qualifications

From: Noah Misch <noah(at)leadboat(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixes for missing schema qualifications
Date: 2018-11-30 06:29:04
Message-ID: 20181130062904.GA2774301@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 29, 2018 at 04:20:24PM +0900, Michael Paquier wrote:
> From what I can see in my backlog, this never actually got into the
> tree, and it seems to me that fixing those issues is always better than
> nothing:
> https://www.postgresql.org/message-id/20180309075538.GD9376@paquier.xyz
>
> Any thoughts? This does not reinvent the wheel..

On Fri, Mar 09, 2018 at 04:55:38PM +0900, Michael Paquier wrote:
> Subject: [PATCH] Fix missing schema qualifications in code
>
> Per CVE-2018-1058, not using proper schema qualifications can allow an
> attacker who has an account on the server to execute arbitrary code as a
> superuser even if he has no such rights. After monitoring the whole
> code of Postgres, I have bumped into four places that need to be
> addressed:

This patch provides no meaningful increment in security or reliability, but it
does improve stylistic consistency. Fine to proceed on those grounds, but
this description doesn't fit.

> --- a/src/test/modules/worker_spi/worker_spi.c
> +++ b/src/test/modules/worker_spi/worker_spi.c
> @@ -115,7 +115,9 @@ initialize_worker_spi(worktable *table)
>
> /* XXX could we use CREATE SCHEMA IF NOT EXISTS? */
> initStringInfo(&buf);
> - appendStringInfo(&buf, "select count(*) from pg_namespace where nspname = '%s'",
> + appendStringInfo(&buf,
> + "select pg_catalog.count(*) "
> + "from pg_catalog.pg_namespace where nspname = '%s'",
> table->schema);

Remove this change. The rest of the file doesn't schema-qualify, which is
appropriate for code implementing a test case.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikolay Samokhvalov 2018-11-30 06:42:42 Re: New GUC to sample log queries
Previous Message David Rowley 2018-11-30 05:58:36 Re: Planning time of Generic plan for a table partitioned into a lot