Re: Protection from SQL injection
От | Thomas Mueller |
---|---|
Тема | Re: Protection from SQL injection |
Дата | |
Msg-id | 5f211bd50804270148i3f658043o8f7f13852859922b@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Protection from SQL injection (Thomas Kellerer <spam_eater@gmx.net>) |
Список | pgsql-sql |
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@DEV_DB and APP_USER@DEV_DB, but only APP_USER@PROD_DB. Or developers know all passwords, but the application configuration is rewieved not to use QUERY_TOOL_USER. Regards, Thomas
В списке pgsql-sql по дате отправления: