Re: Protecting a web app from Postgresql injection - Mailing list pgsql-novice

From Andres Ledesma
Subject Re: Protecting a web app from Postgresql injection
Date
Msg-id 766490.5838.qm@web38012.mail.mud.yahoo.com
Whole thread Raw
In response to Protecting a web app from Postgresql injection  (Mary Anderson <maryfran@demog.berkeley.edu>)
List pgsql-novice
Hi,

It my be interesting to read this : http://lwn.net/Articles/185813/

And, IMHO:
In a web app you can take advantage of the posibility of having several layers, the n-layers model, to validate and filter, even change at your need the users input when security of your apps is at risk.  In that sense avoiding undesired chars in the db tables start at the web pages in form of jsvascript validation, goes on on the middleware, and can be done last time in functions that inserts content in tables.

Personally I do prefer to use  functions ( stored procs ) for inserts and updates of table contents, never use SQL code neither in web pages, neither in middleware objects, always  there is a function that insert or modify the tables content. This allows me to have the db structure deep at the bottom layer of the app, and only people dealing with db knows the real structure of the tables, or db.

Hope this simple hints helps.

Andy

pgsql-novice by date:

Previous
From: Chander Ganesan
Date:
Subject: Re: Group Roles are now Login Roles in pgAdmin?
Next
From: Robert Bernabe
Date:
Subject: Re: Group Roles are now Login Roles in pgAdmin?