Omer van Kloeten's .NET Zen

Programming is life, the rest is mere details

News

Note: This blog has moved to omervk.wordpress.com.

Omer van Kloeten's Facebook profile

Omer has been professionally developing applications over the past 8 years, both at the IDF’s IT corps and later at the Sela Technology Center, but has had the programming bug ever since he can remember himself.
As a senior developer at NuConomy, a leading web analytics and advertising startup, he leads a wide range of technologies for its flagship products.

Get Firefox


powered by Dapper 

.NET Resources

Articles :: CodeDom

Articles :: nGineer

Culture

Projects

Extension Methods and Trust

As much as I love the idea behind extension methods, I can't help but start to think about how it could be used for malicious purposes.

Take this scenario:

  1. You're a disgruntled employee of Evil Inc., the makers of the well known library VeryUsefulAssemblies.NET.
  2. I'm a developer at Good & co., using your Tree<T> class in an assembly called Evil.UsefulAssembly.
  3. Before quitting your job, you decide to add an extension method, System.String.Format(params object[] args), that sends sensitive information back to you and then calls System.String.Format(string format, params object[] args) so no one notices.
  4. I have now unwillingly compromised all of my clients and could never know it, unless I manually check my IL or use a sniffer.

But wait! There's more:

  1. A fellow developer in my company, Norman I. Huntington, decides to write his own Tree<T> and replace all of the references to your Tree<T>, but he forgets to remove the reference to your assembly.
  2. Now my application doesn't even use your assembly, but is still hijacked!

Problem? I think so.

Comments

No Comments