We have a .NET 3.5 application with registered extensions. How can we protect it against DLL Hijacking attacks?
Because of legacy & design problems strong naming
I had came across similar issue, I had ended up writing my own logic for verifying the dll. For me I was just using that dll in LGPL fashion (I can't modify the dll), but wanted to make sure that my application uses the genuine dll (not the hi-jacked one).
Simple solution:
Better solution:
If you have any certificate from trusted CA like verisign, you can use that certificate instead of using RSA key value pair.
This way even if someone replaces your dll with cracked dll, the hash will not match and your application will know the Hijacking attempt.
This approach could is better than only giving dll a strong name because, may be strong name verification can be disabled by running
SN -Vr HijackedAssembly
Hope this helps you, or someone who wants to understand how digital signature things work internally.