Re: Security Issues: Allowing Clients to Execute SQL in the Backend. - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Security Issues: Allowing Clients to Execute SQL in the Backend.
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17CF518F@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to Re: Security Issues: Allowing Clients to Execute SQL in the Backend.  (Hello World <worldanizer@gmail.com>)
Responses Re: Security Issues: Allowing Clients to Execute SQL in the Backend.  (Hello World <worldanizer@gmail.com>)
List pgsql-general
Hello World wrote:
> Denial of service is indeed a problem. Is there a way to limit the execution time of a request?

Yes, setting statement_timeout.

But if a client can exectue arbitrary statements, that could also
be statements like:

SET statement_timeout=0;
SET work_mem=1024GB;

> I'm using libpq to communicate with the server.
> 
> PS. I've just taken a look, it seems I could do some asynchronous queries, time them, then cancel them
> if they take too long.
> 
> http://www.postgresql.org/docs/8.4/static/libpq-cancel.html

That might be a way to avoid that people just reset statement_timeout.
Of course someone could start a deadly query and then kill the client
before it has a chance to cancel it...

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Willy-Bas Loos
Date:
Subject: Re: importing a messy text file
Next
From: Willy-Bas Loos
Date:
Subject: Re: importing a messy text file