Re: User privileges in web database applications - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: User privileges in web database applications
Date
Msg-id 20060629123950.GA1388@surnet.cl
Whole thread Raw
In response to User privileges in web database applications  (Antonis Christofides <anthony@itia.ntua.gr>)
List pgsql-general
Antonis Christofides wrote:

> But I think that checking user privileges at the database level is
> better.  I think it's simpler and more secure, and if later you also
> want to create nonweb apps, you won't have any more
> authentication/privilege headaches.  For this reason, in a web app
> I've made, the app connects to the database as user postgres, and
> after authenticating (receives user's password, checks with pg_shadow,
> and uses session cookie) uses "set session authorization" in order to
> lower its privileges.

What stops the user code from issuing a "RESET SESSION AUTHORIZATION"
command, say from a SQL injection, thus regaining superuser privileges?

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Strange Behavior with Serializable Transcations
Next
From: Simon Riggs
Date:
Subject: Re: Strange Behavior with Serializable Transcations