Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When you consider something as a security threat, you should also think about from whom you are trying to protect.</p> <p>In order for "malicious code" to alter the values of your <code>static</code> properties, this code would need to be loaded into your <code>AppDomain</code> and run. Now think that a malicious attacker has managed to get his code to run in your <code>AppDomain</code> - are your <code>static</code> properties really your major concern? Such an attacker can probably do a lot worst.</p> <p>Unless you have a scenario where you need to load an assembly/code originating from external untrusted sources, I think you don't really need to defend against your user accessing your properties (Not from security perspective anyway - usability is another thing).</p> <p><strong>EDIT - about external untrusted code</strong></p> <p>I still think this is not really your concern. If I understand correctly, you are developing and providing a library, to be used by some 3rd party in their application.</p> <p>If the application owner decided to take some external library which he does not trust, add it to his application, and allow it to run, then this is not your concern, it is the application owner's concern.</p> <p>In this scenario, everything I said above still applies. The malicious code can do much worse then setting your properties. It can mess with memory, corrupt data, flood the thread pool, or even easily crash the <code>AppDomain</code>.</p> <p>The point is, if you don't own the application because you are only providing a class library, you don't need to defend from code running <em>inside</em> the <code>AppDomain</code> where you classes are loaded.</p> <p>Note: Re. NuGet, I wouldn't be too worried about that. NuGet is sort of a static tool. If I understand correctly, it doesn't do things in runtime such as downloading code and running it. It is only used in <em>design time</em> to download binaries, add references, and possibly add code. I think it's perfectly reasonable to assume that an application owner that uses NuGet to download a package will do his due diligence to ensure that the package is safe. And he has to do it only once, during development.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload