Reason behind implicit FullTrust LinkDemand?
From: kv (kv_at_daimi[)
Date: 08/01/04
- Previous message: Bismark Prods: "Re: MD4 class in VB.NET"
- Next in thread: Valery Pryamikov: "Re: Reason behind implicit FullTrust LinkDemand?"
- Reply: Valery Pryamikov: "Re: Reason behind implicit FullTrust LinkDemand?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sun, 1 Aug 2004 19:52:51 +0200
Hi.
I have a simple request: can someone please explain to me, the reasoning
behind strong naming an assembly also implies a FullTrust LinkDemand?
The .NET Framework assemblies (mscorlib.dll, System.*) all have the APTC
Attribute making them useful in scenarios where assemblies have limited
trust (plug-ins etc.); however, in my experience most other assemblies (3rd
party such as log4net, nunit, and many more, and even most of Microsoft's
own non-Framework assemblies, such as Microsoft.mshtml) does not have the
APTCA.
Is it "just to be safe"? One may counter argue that the implicit FullTrust
LinkDemand just forces users to grant full trust to code that doesn't really
need it, thus introducing unnecessary security concerns on the part of the
user?
Hypothetical case in point: I've bought a product from a guy over the
internet. I find it very useful; however, I don't completely trust that it's
not a Trojan, so I limit its access to the network using CAS. It stops
working claiming it does not have sufficient permissions to run. Calling up
the guy accusing him of selling be a Trojan, he assures me that it's just
because it uses log4net or that it uses the HTML component to render the
about box or some other such harmless actions. Now I *have* to grant it
FullTrust and I have absolutely no way of knowing if it's a Trojan (even if
I can see that it never references a System.Net or System.Web class, I could
be sure it didn't do unsavory things by means of unsafe or unmanaged code or
through reflection). What are my options now? What are his options?
The reason I'm asking is that I've lately become very frustrated trying to
employ a security scheme based on CAS in a project of ours, with custom
permissions describing custom actions allowed or not in the system. We
wanted simply to develop permission types PermissionX, PermissionY, and
PermissionZ, and grant some (not all) of these permissions to some
assemblies and some to others, based on a custom scheme. Now, we've long ago
chosen to use a certain 3rd party product for logging throughout our
product. This product consists of an assembly that is strong named (as it
should be), but does not have the APTCA (as many don't). This forces us to
give all our assemblies FullTrust, including(!!!) granting them Permissions
X, Y, and Z, in turn completely foiling our otherwise beautiful scheme.
Not only am I frustrated that so many (very likely harmless) assemblies
LinkDemands FullTrust, I am also frustrated by the mere existence of a
special FullTrust permission set that includes any permissions I may chose
to develop. Why should anyone be made to care if their assembly has been
granted my custom permission (which is included in FullTrust)? Why not just
have a more specific StrongNameLinkPermission that was implicitly
LinkDemanded by strong named assemblies? In the hypothetical case, I could
then choose to grant that permission to the product without granting it
permissions to use sockets. This is in a way the problem in a nutshell: I
can't, as a response to the guys claim that it uses log4net, grant it some
permission that would allow it to use log4net, without also granting it
permission to read stuff from my harddisk and sending them back home over
the internet. (Please note that I am not at all bashing log4net here; as I
mentioned, they are not the only ones not using the APTCA. In fact it's open
source, so a problem with log4net can always be solved quickly).
After having stared at this issue for awhile, I can no longer avoid thinking
that the .NET Framework designers *intended* for the internet guy's product
to be granted all access to umanaged code private class members, and even my
custom permissions. But it makes absolutely no sense to me. What am I
missing?? Am I going nuts?
Thanks
/kv
- Previous message: Bismark Prods: "Re: MD4 class in VB.NET"
- Next in thread: Valery Pryamikov: "Re: Reason behind implicit FullTrust LinkDemand?"
- Reply: Valery Pryamikov: "Re: Reason behind implicit FullTrust LinkDemand?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|