Security and Multi Threading

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.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s