Re: PCI:SSF - Safe SQL Query & operators filter

From: Jeffrey Walton <noloader(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: PCI:SSF - Safe SQL Query & operators filter
Date: 2022-11-08 02:06:56
Message-ID: CAH8yC8kM6wsDRjrQ=nmEME71nOLoefmJCy4SQbBGwUmwENAr8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Nov 7, 2022 at 8:25 PM Jan Bilek <jan(dot)bilek(at)eftlab(dot)com(dot)au> wrote:
> ...
> select * from pg_read_file('/etc/passwd' , 0 , 1000000); -> it's possible to display content of '/etc/passwd/' file
> select version(); -> Result of DBMS version request.

Input filtering may help in the interim, until you get the roles and
privileges sorted out.

> COPY (SELECT 'nc -lvvp 2346 -e /bin/bash') TO '/tmp/pentestlab'; -> it's possible to create files on the filesystem on behalf of 'postgres' user.

Prepared Statement or Parameterized Query here. In this case, don't
execute data as code.

Jeff

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2022-11-08 03:19:48 Re: PCI:SSF - Safe SQL Query & operators filter
Previous Message David G. Johnston 2022-11-08 01:51:02 Re: PCI:SSF - Safe SQL Query & operators filter