Re: Exec permissions on Stored Procedure
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Tue, 05 Aug 2008 14:42:56 -0700
Mark B (mark_bert@xxxxxxxxx) writes:
On Aug 5, 11:14 am, "gv" <viator.ge...@xxxxxxxxx> wrote:
If I grant EXEC permissions on a Stored Procedure to a Domain User
shouldn't they be able to Execute that stored procedure reguardless if
they have Select permissions on a table that the Stored Procedure uses?
Interesting timing. I was just about to make a post concerning the
same thing. On my SQL2000 system (not sure which sp), If I grant
execute permission on a stored procedure, that's all that needs to be
done. I'm working on another system that has SQO2005 and it's
requiring me to also grant select permission to the underlying table.
This seems like a gaping security hole to me. I hope someone out there
has an answer for this.
No, it's not a security hole, it's that you probably have not grasped
the mechanism wherby a user gets access to objects through stored
procedures.
We often think of it as "if a users the rights to execute a stored
procedure, he does not need access to the underlying table", but there is
a very important assumption which is tacitly understood: the table and
the procedure have the same owner. The mechanism is therefore also known
as *ownership chaining*.
And, oh, there is another important thing as well: ownership chaining
does not apply to dynamic SQL, because dynamic SQL is not part of the
procedure that invokes it, and the dynamic SQL has no owner, so there
can be no ownership chaining.
If you want more information on ownership chaining and other
permission mechanisms, this article on my web site may be of
interest: http://www.sommarskog.se/grantperm.html.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- Re: Exec permissions on Stored Procedure
- From: Mark B
- Re: Exec permissions on Stored Procedure
- References:
- Exec permissions on Stored Procedure
- From: gv
- Re: Exec permissions on Stored Procedure
- From: Mark B
- Exec permissions on Stored Procedure
- Prev by Date: Re: Exec permissions on Stored Procedure
- Next by Date: RE: Cannot create linked server from SQL 2005 to SQL 2000
- Previous by thread: Re: Exec permissions on Stored Procedure
- Next by thread: Re: Exec permissions on Stored Procedure
- Index(es):
Relevant Pages
|