sandbox

Safely sandbox and execute user submitted JavaScript?

空扰寡人 提交于 2019-11-27 06:48:33
I would like to have the ability to let users submit arbitrary JavaScript code, which is then sent to a Node.JS server and safely executed before the output is sent back to multiple clients (as JSON). The eval function comes to mind, but I know this has multiple security concerns (the user submitted code would be able to access Node's File API, etc). I have seen some projects like Microsoft Web Sandbox and Google Caja which allow execution of sanitized markup and script (for embedding third-party ads on websites), but it seems that these are client-side tools and I'm not sure if they can be

security problem with Java ScriptEngine

蹲街弑〆低调 提交于 2019-11-27 06:47:37
问题 I just started to use the Java ScriptEngine to do little extensions to my Application then i noticed that i can import all the java classes in the script and use them without restrictions. Is there a way to specify what classes a script can use? I dont want them to do things like java.lang.System.exit(1); 回答1: Well, you seem to need to learn about the Java SecurityManager. That's a pretty large topic, you might want to read up on it and then post a more specific question if you have trouble

Looking for a practical approach to sandboxing .NET plugins

和自甴很熟 提交于 2019-11-27 05:52:41
I am looking for a simple and secure way to access plugins from a .NET application. Although I imagine that this is a very common requirement, I am struggling to find anything that meets all my needs: The host application will discover and load its plugin assemblies at runtime Plugins will be created by unknown 3rd parties, so they must be sandboxed to prevent them from executing malicious code A common interop assembly will contain types that are referenced by both the host and its plugins Each plugin assembly will contain one or more classes that implement a common plugin interface When

Disable Java reflection for the current thread

青春壹個敷衍的年華 提交于 2019-11-27 04:31:19
I need to call some semi-trustworthy Java code and want to disable the ability to use reflection for the duration of that code's execution. try{ // disable reflection somehow someObject.method(); } finally{ // enable reflection again } Can this be done with a SecurityManager, and if so, how? Clarification/Context: This is a follow-up to another question about restricting the packages that can be called from JavaScript/Rhino. The accepted answer references a blog entry on how to do that, and it requires two steps, the first one using a Rhino API (ClassShutter), the second one turning off

Instagram API doesn’t find any liked posts for sandbox users

柔情痞子 提交于 2019-11-27 03:31:40
I’m using the Instagram API in sandbox mode. I’m trying to access a User’s liked posts from the Instagram API using their authenticated access token. This user is one of the accepted sandbox users for my app, and has liked some posts. If I call other endpoints with the same token, I get some data, but accessing /users/self/media/liked returns empty data. I’m using this URL: https://api.instagram.com/v1/users/self/media/liked?access_token={verified access token} and this is the result I’m receiving: {"pagination": {}, "meta": {"code": 200}, "data": []} Because it has a 200 return code, the

How to use Accessibility with sandboxed app?

二次信任 提交于 2019-11-27 02:59:44
问题 OS X have a nice feature such as Accessibility API, which allow to control some system elements and another applications from your app code. But it stops working after turning on Sandbox. To submit an app to the store is mandatory to turn on sandboxing. That`s what Apple say: With App Sandbox, you can and should enable your app for accessibility, as described in this document. However, you cannot sandbox an assistive app such as a screen reader, and you cannot sandbox an app that controls

How to create a lightweight C code sandbox?

杀马特。学长 韩版系。学妹 提交于 2019-11-27 02:52:55
I'd like to build a C pre-processor / compiler that allows functions to be collected from local and online sources. ie: #fetch MP3FileBuilder http://scripts.com/MP3Builder.gz #fetch IpodDeviceReader http://apple.com/modules/MP3Builder.gz void mymodule_main() { MP3FileBuilder(&some_data); } That's the easy part. The hard part is I need a reliable way to "sandbox" the imported code from direct or unrestricted access to disk or system resources (including memory allocation and the stack) . I want a way to safely run small snippets of untrusted C code (modules) without the overhead of putting them

iPhone storekit sandbox stopped working

筅森魡賤 提交于 2019-11-27 02:28:03
问题 Bug reported as fixed by Apple, see accepted answer below ... UPDATE MON AUG 23rd 10:00 GMT Although the bug report with apple hasn't been closed yet, it now seems to be working (at least for a couple of us) OK. It could be they have nailed it, or the fix is in testing, and I'll report back when (if) I hear anything more from Apple. UPDATE FRI AUG 20th Just to say I've had an email back from Apple Engineering (21:20 GMT) and they have said: "Thank you for reporting this. We're aware of this

Paypal sandbox IPN return INVALID

自古美人都是妖i 提交于 2019-11-27 02:27:28
问题 I am trying IPN callback, using servlet. The code I am using is provided by paypal for verifying the ipn data. But every time i getting a INVALID response. Here is the code: Enumeration en = req.getParameterNames(); String str = "cmd=_notify-validate"; while (en.hasMoreElements()) { String paramName = (String) en.nextElement(); String paramValue = req.getParameter(paramName); //str = str + "&" + paramName + "=" + URLEncoder.encode(paramValue,"UTF-8"); // for UTF-8 i set the encode format in

Ruby: creating a sandboxed eval?

可紊 提交于 2019-11-27 01:19:32
问题 My Rails app has complicated rules about when a bit of content should be displayed on a page or not. I've decided to implement this by writing predicates (simple 'yes/no' functions) in Ruby and storing them in the db for subsequent eval'ing. It it pretty straightforward. My main concern is security: if a malicious somebody figures out how to write to the db, they could stick arbitrary Ruby code in the db and then ' all your base are belong to us '. So is it possible to create an 'sandboxed'