
Custom Configuration Providers
Regardless of the current user's security token, custom section-handler code runs using the credentials of the hosting process account. For Web scenarios, this is the <server>\ASPNET account on Windows 2000 and Windows XP, the NETWORK SERVICE account on Windows Server 2003, or an explicitly configured user account. For client scenarios, this is the identity of the process that is currently running.
The configuration system sets permissions before calling a custom configuration section handler, and the call is not trusted in any way by the .NET Framework. The call runs with the trust permission of the application. The ASP.NET configuration system trusts the %SystemRoot%\Microsoft.NET\Framework\version\CONFIG directory, but it does not trust directories that are located lower in the hierarchy.
A custom configuration section handler should set Code Access Security (CAS) demand attributes to obtain permissions. For more information, see ASP.NET Code Access Security or Code Access Security Basics.
Holding a File-Lock on a Configuration File
Only multiple attempts to save to a configuration file or open a file handle can lock a configuration file. A malicious user might attempt to lock the Machine.config file or the root Web.config file, but Full trust is required to do that, and is disabled in ASP.NET by default.
Using the Configuration API to Read Arbitrary Files
The classes of the configuration API cannot read any directories that are not part of the application domain, or any files that do not have a .config file name extension.