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 652489
In Process

The Archive Base Latest Questions

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

imagine the following environment: an XBAP application running in partial trust mode (default behaviour;

  • 0

imagine the following environment: an XBAP application running in partial trust mode (default behaviour; requiring Full Trust is not an option – but before you ask, if full trust is given to the XBAP, everything works as expected) is referencing a locally installed assembly, which is located in the GAC. To achieve this, we enable the “AllowPartiallyTrustedCallers” option to the local assembly, and also full trust is granted. (imagine this is some kind of a local connectivity counterpart)

(by the way we are aware of the security aspects of using the AllowPartiallyTrustedCallers attribute, this is out of scope of this post though, just don’t care)

Now, even if our local GAC assembly has full trust (we can check this by calling Assembly.GetExecutingAssembly().IsFullyTrusted at any time), it will fail any demands (implicit or explicit) since it’s called by a partially trusted caller (our XBAP). (correct me if i am misunderstanding something). Fortunatelly, we can do explicit asserts to gain permissions inside our local GAC assembly, for example:

new System.Security.Permissions.FileIOPermission(.....).Assert();

By that, we could prevent a full stack walk on demands right at this point and do any file access as we want. (again, please correct me…)
This actually works perfectly! (in this case)

The problem is, we just don’t do any file IO, in fact we are calling external libraries which should be able to do anything they want (and they might do a lot of stuff, accessing the registry, making web service requests, write files, call unmanaged code – in detail we don’t know, but we can trust them), and prevent the demand stack walk to reach our partially trusted caller. We should be able achieve this, since everything is done from our locally installed and trusted GAC assembly. (again, please don’t care about security aspects here, just assume, that we can trust the client)

Approach to solve this:

  • What we thought of first, was asserting a set of permissions (PermissionSet) to nearly any permission before working with the external library. This almost works, but it looks like at some point still a security exception occurs – either, because the external library might start more threads which fail by some reason, or because its accessing the entryassembly – in fact, we don’t know.

  • Second, we tried the following ttribute

[System.Security.Permissions.PermissionSet(
  System.Security.Permissions.SecurityAction.Assert, Name = "FullTrust")]

it didn’t work either.

  • Third, we thought of opening a new AppDomain, making the fully trusted GAC assembly the AppDomains entry point, and run anything inside this appdomain – any stack walk could never reach the partially trusted caller anymore – in our theory). Unfortunatelly, we’re not able to achive this… Or newly created AppDomain fails even more demands, even if set up to run under “MyComputer” security zones Evidence or unrestricted SecurityPermission. I am not able to explicitly grant full trust to the whole AppDomain.

  • Fourth, using caspol is not an option. (due to deployment reasons)

Now, since this should be a lot of information, i hope you understand what we want to archive.

To get this to the point: How can a fully trusted assembly assert a complete full trust to assemblies it calls, stopping all stack walks to reach the partially trusted caller?

many Thanks in Advance

  • 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-13T22:16:41+00:00Added an answer on May 13, 2026 at 10:16 pm

    Looking at the documentation from Microsoft in regards to allowing Partially Trusted Callers to Full Trust Assemblies I do not believe that this is going to be possible to do.

    You keep stressing that we need to avoid the security concerns, but in all reality, what you are trying to do with your solution is bypass essentially every single portion of the code access security system within the .NET Framework, and I’ll be hard pressed to believe that you are going to be able to get a viable solution.

    On top of this, I can’t imagine that this process is something that really needs to be done this way.

    Couldn’t you offload this processing from the partially trusted caller to then pass off communications to something running locally and already trusted?

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

Sidebar

Related Questions

Imagine following scenario: We have a lot of parallel development going on in several
Imagine the following scenario: class MyClass extends OtherClass<String>{ String myName; //Whatever } class OtherClass<T>
Imagine the following table (called TestTable ): id somedate somevalue -- -------- --------- 45
Imagine the following database: Table 'companies' has fields id, name and flagship_product_id. Table 'products'
Imagine the following: you read in a string with scanf() but you only need
Imagine the following folder structure: project src code.c makefile bin How can I compile
Imagine the following situation: I have two branches: DEV and MAIN. I'm working on
Imagine the following class that manages a resource (my question is only about the
Imagine the following situation: struct Args { bool arg; }; void thing(Args arg) {
Imagine the following markup: <a href=#link01>1</a> <a href=#link02>2</a> And: $('a').click(function(){ var href = $(location).attr('href'),

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.