Support a`--with-copy-program` compile flag - Mailing list pgsql-hackers

From Steve Chavez
Subject Support a`--with-copy-program` compile flag
Date
Msg-id CAGRrpza_WUY_jaN4P-xkN=TdqfxH+eJJazZAo5gg=kQoEaQnVw@mail.gmail.com
Whole thread Raw
Responses Re: Support a`--with-copy-program` compile flag
Re: Support a`--with-copy-program` compile flag
Re: Support a`--with-copy-program` compile flag
List pgsql-hackers
Hello hackers,

Postgres provides the `COPY .. TO/FROM PROGRAM` statement. This is dangerous from a security perspective because it allows users to escape from the SQL sandbox and gain shell access on the instance. 

Now there's the `pg_execute_server_program` predefined role to restrict access to `COPY.. TO/FROM PROGRAM` but if somehow a pg user gains superuser privileges then the predefined role is of no use.

So I wonder if we could remove the possibility of shell access by providing a `--with-copy-program` compile flag. 

Best regards,
Steve Chavez

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Update timezone to C99
Next
From: Heikki Linnakangas
Date:
Subject: Re: Support a`--with-copy-program` compile flag