Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 588465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:19:16+00:00 2026-05-13T15:19:16+00:00

I’ve reviewed the .NET Strong Name process a few times and think I’m comfortable

  • 0

I’ve reviewed the .NET Strong Name process a few times and think I’m comfortable with it, but I’m left with what I think is a security gap:

I’m working on a system whereby we store serialized .NET assemblies in our MS SQL database. They are read by a public-facing web application that deserializes and caches them. This is done to allow remote addition of new plugins without having to redeploy the web app.

I have some concerns about author verification, however. Both the web app and the plugin assemblies have strong names using the same public-private key. In that way I’m guaranteed that the plugins can’t be tampered with, but I see one scenario in which a malicious user could execute their own code:

  1. The user implements an assembly that implements the interface our plugins are using (this is nontrivial since the plugins are not distributed – we create them internally).
  2. The user gives this assembly a strong name of their own
  3. The user manages to inject their assembly into the appropriate table in our database
  4. The web application loads this assembly and instantiates the constructor for the interface the malicious user implemented – it is now executing their code

It’s my understanding that the .NET Framework will only check that an assembly has a strong name and that it hasn’t been tampered with – it doesn’t say anything about verification of the author.

Thus, the last piece of my puzzle is to somehow verify that the signature in an assembly is in fact our own. Am I missing some fundamental piece that’s already been addressed, or is strong naming not designed to handle this case? If so, can anyone suggest how to address this problem?

[Edit]
Thanks Khalid! My problem was that one of my test plugins was signed using a test key – I had since regenerated it (don’t ask) and applied it to the other assemblies but missed that one. As a result, I thought that GetPublicKey() was returning inconsistent values!

Code snippet for anyone who is following this path:

private bool ValidateAssembly( byte[] deserializedAssembly ){
   byte[] ourKey = Assembly.GetExecutingAssembly().GetName().GetPublicKey();
   for (int i=0; i < deserializedAssembly.Length; i++){
      if ( deserializedAssembly[i] != outKey[i] )
         return false;
    }
    return true;
}

(Any error handling or non-public key checks removed for clarity)

Note this works as long as the executing assembly (web app) and plugins are signed using the same key. This works for us internally but if your plugin API is public you’d need a different way of managing trust.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:19:16+00:00Added an answer on May 13, 2026 at 3:19 pm

    Your attack sounds plausable until I read aloud this sentence.

    The user manages to inject their assembly into the appropriate table in our database

    If the hacker has access to your database, I think that is a bigger problem than worrying about the code he is going to be executing. But anyways, below is some code to get the public key of the assembly you might load. You can check it against your keys and make sure it is not some other signature.

    AssemblyName asmName = asm.GetName();
    byte[] key = asmName.GetPublicKey();
    bool isSignedAsm = key.Length > 0;
    Console.WriteLine( "IsSignedAssembly={0}", isSignedAsm )
    

    The AssemblyName class should give you enough information to decipher whether your signature matches the key you provide people.

    Now if a hacker has your keys (public/private) then he’s working from the inside, and that is a bigger problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.