A lot of the security primitives in .NET depend on extra information attached to the current thread, e.g. CurrentPrincipal, CAS Markers and Impersonation Tokens.
Ever wondered what happens when you spin off a new thread – is this vital security information correctly propagated??
Easy Answer (.Net 1.1) : NO.
e.g. Delegate.BeginInvoke and Thread.Start copy Thread.CurrentPrincipal – System.Threading.Timer and ThreadPool.QueueUserWorkItem do NOT !
I attended Mike Woodrings talk about that topic at WinDev which was very interesting – beware when you are doing multi threading in 1.1 !!!
the good news are that in Whidbey everything will behave more as “expected”.
Mike showed an excellent proof-of-concept code that demonstrated all the various scenarios and how .net behaves. Just convert the solution to Visual Studio 2005 and watch how the results differ. highly recommended.