SecurityException for registry access while opening SQL Connection

From: Brian Noyes (brian@softinsight.com)
Date: 01/28/03


From: "Brian Noyes" <brian@softinsight.com>
Date: Tue, 28 Jan 2003 10:41:28 -0500


I have something strange going on on two of my development machines. If I do
something as simple as trying to open a SQL connection to a database from an
ASP.NET page, I get a security exception for registry access. The exact same
code on my two other machines does not cause this. See below for the
exception dump.

If I go an change machine.config processModel to use SYSTEM as the user
instead of machine, the problem clears up, but that is a security hole.

Any ideas why opening a SQL connection would require registry access on one
machine but not another. They are all trying to access it as ASPNET, and
that user has been granted access.to the database. The registry security
access check appears to be happening after the database access check,
because if I deny the ASPNET user access to the database, that exception is
thrown first.

I'm sure it is some config setting somewhere, but I have not done any
tweaking of config on these machines myself. In fact on one of them, I
uninstalled VS.NET, .NET, SQL, and IIS, and reinstalled them all with latest
service packs and it did not clear the problem.

Any help greatly appreciated.

Security Exception
Description: The application attempted to perform an operation not allowed
by the security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.

Exception Details: System.Security.SecurityException: Requested registry
access is not allowed.

Source Error:

Line 52: {
Line 53: SqlConnection conn = new
SqlConnection("server=localhost;Trusted_Connection=true;database=Northwind")
;
Line 54: conn.Open();
Line 55: conn.Close();
Line 56: }



Relevant Pages

  • Re: the exploit that wasnt
    ... The other Mac Book Pro? ... brought Microsoft into a security discussion about Mac OS X. ... The number of security patches, ... if you were to scan random machines on the internet for a week, how many Unix machines do you believe you would hit? ...
    (comp.sys.mac.advocacy)
  • Re: Cryptogram Comment
    ... Or had to go through setting up basic security for their ... > bother me with Windows questions. ... > machines are broken. ... and Linux and other open OS's make all patches FREE to redistribute. ...
    (sci.crypt)
  • Re: Temporary Ban On Links In Posts To SRI
    ... understand that there is a risk when clicking ... low)" in the general case does not apply to SRI. ... implement the security measures recommended. ... update" even with machines that are restricted to only applications ...
    (soc.religion.islam)
  • Re: the exploit that wasnt
    ... The other Mac Book Pro? ... brought Microsoft into a security discussion about Mac OS X. ... The number of security patches, ... if you were to scan random machines on the internet for a week, ...
    (comp.sys.mac.advocacy)
  • Re: Small Business Server Networking Wizard was not installed
    ... IE browser helper toolbar with some sort of security features enabled. ... WINSOCK fix, all these things were done on both of these machines, nothing ... Server Networking Wizard would not run on and nothing helped. ... ActivX garbage to install on either of these two machines. ...
    (microsoft.public.windows.server.sbs)