Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Protection from SQL injection



Hi,

>  I fail to see how the backend could distinguish between a query sent by a
> query tool and a query sent by an "application".

The backend could use a different client library (a client library
that doesn't allow literals). But in this case two or three client
libraries are required.

Probably better is to restrict in the database.

There would be a user (or role) for the query tool and one for the
application. Maybe the SET ALLOW_LITERALS is not such a good idea.
What about REVOKE LITERAL_TEXT FROM APP_ROLE. So LITERAL_TEXT and
LITERAL_NUMBER would be rights (similar to REVOKE USAGE ON LANGUAGE
... FROM ...).

It's an access rights problem. Let's say there is a development
database (DEV_DB) and a production (PROD_DB). There are two users /
roles on those systems: APP_USER (no literals) and QUERY_TOOL_USER
(literals allowed). The passwords are different on each system.
Developers know the password for QUERY_TOOL_USER(at)DEV_DB and
APP_USER(at)DEV_DB, but only APP_USER(at)PROD_DB(dot) Or developers know all
passwords, but the application configuration is rewieved not to use
QUERY_TOOL_USER.

Regards,
Thomas



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group