dbTalk Databases Forums  

Stored Procedures and Security

comp.databases.informix comp.databases.informix


Discuss Stored Procedures and Security in the comp.databases.informix forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andrew Rowe
 
Posts: n/a

Default Stored Procedures and Security - 08-16-2005 , 05:05 AM






Hi All,

I'm finding that stored procedures seem to bypass table-level privileges and
allow data to be selected from tables that the user has no select permission
on. Is this a bug?

This has surprised me given the discussion entitled "Using Stored Procedures
to Control Access to Data" in the "Informix Guide to Database Design and
Implementation" (4364.pdf). This section discusses creating a DBA procedure
to read from a table that the user does not have select permission on. Why
put this section in the manual if any procedure can do this?

OS: UnixWare 7.1.1
IDS: 7.31.UD8

Regards,
Andrew
PS Also tried this on 9.40.TC1E1 on Windows XP with the same result




Reply With Quote
  #2  
Old   
Andrew Rowe
 
Posts: n/a

Default Re: Stored Procedures and Security - 08-16-2005 , 11:14 AM






It seems odd that there would be a discussion on the use of DBA procedures
in the manual to
get around security if you don't require a DBA procedure to do so.

(Digression) This begs the question: what are DBA procedures for?

Unfortunately, I don't think I can code around this as we will be using
roles to enforce security.

I can easily determine if a particular user has select permissions on a
table and also if any of the roles
that they have been granted has select permissions.

The kicker is how to find out if a particular role has been invoked with SET
ROLE...



"rkusenet" <rkusenet (AT) yahoo (DOT) com> wrote

Quote:
This is not a bug. It is expected in Stored Procedures.

And BTW the same behaviour exists in SQL Server too.

Can this be disabled. I am not aware of any mechanism. I am
sure there must be some way, otherwise you can always code
it in the stored procedure.


"Andrew Rowe" <andrew.rowe (AT) manufacturing (DOT) demon.co.uk> wrote in message
news:PTiMe.10592$JB4.1747 (AT) newsfe6-win (DOT) ntli.net...
Hi All,

I'm finding that stored procedures seem to bypass table-level privileges
and allow data to be selected from tables that the user has no select
permission on. Is this a bug?

This has surprised me given the discussion entitled "Using Stored
Procedures to Control Access to Data" in the "Informix Guide to Database
Design and Implementation" (4364.pdf). This section discusses creating a
DBA procedure to read from a table that the user does not have select
permission on. Why put this section in the manual if any procedure can do
this?

OS: UnixWare 7.1.1
IDS: 7.31.UD8

Regards,
Andrew
PS Also tried this on 9.40.TC1E1 on Windows XP with the same result







Reply With Quote
  #3  
Old   
Andreas Legner
 
Posts: n/a

Default Re: Stored Procedures and Security - 08-16-2005 , 03:32 PM



You might be missing http://publib.boulder.ibm.com/infoce...doc/udr198.htm

esp. the phrase "The user who executes the UDR runs with the privileges of the owner of the UDR."

HTH,
Andreas

Reply With Quote
  #4  
Old   
Andrew Rowe
 
Posts: n/a

Default Re: Stored Procedures and Security - 08-17-2005 , 01:59 AM



Hmmm yes, but the same article also states " The database server checks the
existence of any referenced objects and verifies that the user who invokes
the UDR has the necessary privileges to access the referenced objects "

It then goes on to say "For example, if a user executes a UDR that updates
data in a table, the user must have the Update privilege for the table or
columns referenced in the UDR."

This is pretty clear - but was not the behaviour I was seeing.

After much fiddling I have determined that the above statements ARE correct
provided two conditions are met :-

1 - The owner of the UDR in not a DBA at the time the UDR is invoked.
2 - The owner of the UDR is not the owner of the tables(s) to which the UDR
refers.

Provided these conditions are true, you can elicit a -272 from procedure
based on the invoking user's privileges if such is your desire.

"Andreas Legner" <andreas.legner (AT) weihenstephan (DOT) org> wrote

Quote:
You might be missing
http://publib.boulder.ibm.com/infoce...doc/udr198.htm

esp. the phrase "The user who executes the UDR runs with the privileges of
the owner of the UDR."

HTH,
Andreas



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.