Pgsql roles, SQL injection, and utility statements

From: Chris Travers <chris(at)travelamericas(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Pgsql roles, SQL injection, and utility statements
Date: 2007-09-14 17:11:28
Message-ID: 46EAC0C0.4080805@travelamericas.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all;

I have a bit of concern about writing applications which use Pgsql roles
for security.

Since the utility statements are not parameterized, the easiest way to
manage the roles in an application is to use stored procedures which
EXECUTE strings to create SQL queries. These EXECUTE statements
include user-supplied data, and since these would generally run with
some sort of administrative rights, I am worried about people doing
things like:
select * from add_user_to_role('username', 'rolename; drop table foo;');

Is this a problem? Is there a way to do this safely?

Best Wishes,
Chris Travers

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mark Morgan Lloyd 2007-09-14 17:44:46 Re: Tablespaces on tertiary media
Previous Message Ron Johnson 2007-09-14 16:44:04 Re: Tablespaces on tertiary media