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

  • Home
  • SEARCH
  • 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 6866477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:11:19+00:00 2026-05-27T03:11:19+00:00

from writing ABAP programs, the following methodology is known to me as an ‘exit’

  • 0

from writing ABAP programs, the following methodology is known to me as an ‘exit’ to a program, for this reason I choose the names accordingly.

Suppose you, in .Net,

1) define an interface

namespace Exits {
    public interface Exit {
       int exitMethod(string s); // signature serves as example only
    }
}

2) provide some way to the user of your application to pass the name of a user written
assembly ExitImplementation.dll and the name of a class, say myClass : exit, implementing the interface exit, to your application. E.g. as command line parameters or in some form.

You store the name of the user assembly in string assemblyName and the name of the class (including namespace) in string theImplementation and then load it an execute it:

3)

    Assembly assembly = Assembly.LoadFrom(assemblyName); 
         // assuming assembly is deployed by user into folder where application resides
    Exit theExitImplementation = assembly.CreateInstance(theImplementation) as Exit;

    int k = theExitImplementation.exitMethod("whatever");  

(First question, of minor importance: does this technique have a name outside of the ABAP world, and what is it called? 🙂 )

What I’d like to know is which risk are you taking by letting your application execute this user code (forgive me in case that’s a naive questions, I’m still new to .Net). Let’s say the output is only some message code needed to determine some message output to some log.

Assume as deployment scenario some company using the application for doing their business and some employee of that company writing the exit implementation. If that employee wants to cause damage, what would be at risk:

  1. nothing but a wrong message in the log?
  2. content of class instances of the application?
  3. resources of the PC the application is running on?
  4. worse?

It is my impression the answer is 4. isn’t it? myClass gets the oppurtunity to execute and hence can basically do what any application can do which was started by the user who is running the original application. Are there means to prevent this?

If so: does it make any difference (if so, which), that the signature of the exit is fixed and that the input to the method cannot be changed in the method?
This method by intention does not allow the type to be defined dynamically.

This method, also by intention, only allows input which cannot be altered.
Assume the string argument is replaced by some other type which the caller could modify, like StringBuilder. Is this increasing the risk?

Are there more sophisticated (standard) techniques to reduce the risk with this approach? Are there alternative approaches?

  • 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-27T03:11:20+00:00Added an answer on May 27, 2026 at 3:11 am

    Called method signature (generally) doesn’t matter as long as you call external, untrusted method without any security precautions.

    You should revoke as many SecurityPermissions as possible to minimize attack surface exposed by calling untrusted code from GAC/trusted code. Take a look at this tutorial to get a general idea how .NET Security works. The following should take care of any disruptive behavior external code could cause:

    NamedPermissionSet ps = new NamedPermissionSet("Nothing");
    ps.Deny();
    CallYourUnsafeMethodHere();
    CodeAccessPermission.RevertAll();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a program to read from a POP3 mailbox and upload the email
I'm writing this question from the standpoint of an ASP.NET application. However I realize
The following is excerpted from Writing solid code , page 115. int strcmp( const
Is it possible to prevent user from writing letters to a textbox (i.e. force
I am little confused... Is it true that reading\writing from several threads all except
I have some troubles while writing logs from log4net to the file. I seem
From the MSDN documentation: Synchronized supports multiple writing threads, provided that no threads are
After writing code to populate textboxes from an object, such as: txtFirstName.Text = customer.FirstName;
im writing a script to get services from local and remote machines. I've had
I'm writing an XSLT data map from one XML schema to another XML schema.

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.