How SQL Server stored procedures use EXECUTE AS and ownership chains to grant table access
The article explains that stored procedures can let callers reach tables without direct table permissions, with the effective authority determined by module execution context and ownership chains. It describes how SQL Server skips a second permission check when a module and its referenced objects share an owner, and outlines the EXECUTE AS options of CALLER, SELF, OWNER, or a named principal. It warns that a procedure owned by a highly privileged account can become a broad access path, so reviews should focus on the code and module identity. Recommended practices include inventorying modules with non-caller contexts, scrutinizing dynamic SQL and cross-database calls, auditing ownership and impersonation changes, and testing with low-privilege accounts. The author concludes that these tools reduce direct grants but become risky when the delegated identity exceeds what the task requires.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in