473,806 Members | 2,332 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Executing Untrusted Code

Ben
Hello,

I've been developing apps in Delphi for years and have just started
writing my first big project in c# + ms .net and have some questions
about security and untrusted code.

I've got an app that will run on a server on the net that will have
plugin capability, where a user could build an assembly that contains
a type derived from my base plugin type. I plan to load the plugin
assembly at runtime, instanciate the derived type and call it's
methods. Because of the nature of the project I cannot trust plugins
developers (can be anyone) not to write malicious code in their
plugin.

My main concerns with malicious plugin code are that:
1. The plugin may try to do naughty things like deleting files or
sending emails, etc.

2. The plugin may be able to access parts of the main application
which it shouldn't be allowed to see.

3. The plugin may get stuck in an infinate loop, effectively hanging
the entire app. I'd really like to stop executing the method of the
plugin if it takes longer than a set number of milliseconds.

4. The plugin may consume lots and lots of memory using collections,
etc.

Though I know little of it as yet, I figure I can use code access
security to limit the priviledges of the plugin which would hopefully
take care of concern #1 (right?). But as for the other concerns I'm
really not sure? I'm guessing for #3 I'd have to run the plugin in a
seperate thread and kill the thread if it takes too long?

I've studied what I can of the terrarium project which is very
similiar technically and somehow overcomes similiar issues but
unfortunately it seems microsoft never released the source code. :(

The project depends on the ability of .net to run untrusted code
safely which I thought it could. I just have to learn how. Can anybody
suggest what I can do to overcome any of these issues or atleast point
me in the right direction?

Feb 27 '07 #1
0 1378

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1925
by: Jim Dabell | last post by:
I'm in the middle of writing a small app for Linux that needs to create directories that take their names from untrusted data. If possible, I'd like to preserve special characters rather than switching them with dummy characters. For instance, using bash, I'd just escape characters with backslashes when I want to create a directory name with, say, a slash in. I've been through the manual, Google and Usenet, and I've done a bit of...
4
12684
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck Gatto Dan Guzman Apr 27 2000, 12:00 am show options
9
5573
by: Jim Washington | last post by:
I'm still working on yet another parser for JSON (http://json.org). It's called minjson, and it's tolerant on input, strict on output, and pretty fast. The only problem is, it uses eval(). It's important to sanitize the incoming untrusted code before sending it to eval(). Because eval() is evil http://blogs.msdn.com/ericlippert/archive/2003/11/01/53329.aspx apparently in every language. A search for potential trouble with eval() in...
0
1648
by: Logu | last post by:
Hi, I am getting Untrusted Webserver in if i am adding exisiting Asp.net project in windows 2000 server.. Pl guide me.. Thanks Logu...
5
1243
by: Devan L | last post by:
Is there any safe way to create an instance of an untrusted class without consulting the class in any way? With old-style classes, I can recreate an instance from another one without worrying about malicious code (ignoring, for now, malicious code involving attribute access) as shown below. >>> import types >>> class Foo: .... def __init__(self, who, knows, what, args): .... self.mystery_args = (who, knows, what, args)
3
9820
by: King Ron | last post by:
Ola all: I had a call from a client yesterday. She reports that when attempting to connect to a AC2002 mdb backend on a remotely shared pc (mapped locally as \\Server\Users) she suddenly began receiving the error described in KB810582. http://support.microsoft.com/kb/810582/EL/ 'Microsoft Access cannot open this file.
4
2431
by: Joseph Gruber | last post by:
Ok, so I'm about to go nuts. Here's the background -- My Documents is redirected to a network location and My Documents is an offline folder. So my projects location is located in my (network) My Documents location. Everytime I open a project I get the message: The project location is not trusted... I've attempted to allow the My Documents location (\\server.domain.com \username\*) as a Fully Trusted location in .NET 2.0...
2
1845
by: Andrey Fedorov | last post by:
Is the scope of a closure accessible after it's been created? Is it safe against XSS to use closures to store "private" auth tokens? In particular, in... ....can untrusted code access 'secret', or only the code inside foo? - Andrey
9
1436
by: Emanuele D'Arrigo | last post by:
I noticed that this issue has been discussed in this newsgroup periodically over the years and I seem to understand that - comprehensive- safe/restricted execution of untrusted code in python is currently quite hard to achieve. What if the safety requirements are a little relaxed though? All I'd want to prevent is for the code opening/damaging files, formatting drives or similarly catastrophic exploits. I'm not particularly concerned if...
0
10618
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10371
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10110
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9187
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.