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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:38:19+00:00 2026-05-19T12:38:19+00:00

All, I’m working on the design of a cloud-based service that will provide the

  • 0

All,

I’m working on the design of a cloud-based service that will provide the option to execute some “plugin” code submitted by clients. In order to make this work it is essential that the plugins can’t threaten system integrity or have any ability to access the data of other clients.

Ideally I’d like it to be possible for clients to submit a simple jar file (containing a class conforming to some pre-defined interface) which would then be run within a sandbox.

The client code should be allowed to:

  • Take as much CPU time as it needs on a single thread
  • Perform any calculations using standard java classes (e.g. java.lang.Math, java.util.Random etc.)
  • Call any libraries bundled in the jar (but which must be subject to the same restrictions)

But I would specifically need to disallow the following:

  • Spawning new threads (so that server resource can be fairly managed!)
  • Any access to the file system / IO / network
  • Any access to native code
  • Any access to data in the JVM other than that passed to / created by the client code
  • Any access to reflection on classes other than those in the .jar sandbox
  • Any ability to call methods on objects outside the sandbox, other than the standard Java libraries

Is it be possible to achieve this with a custom ClassLoader / SecurityManager setup? Or will I need to start looking for a more sophisticated solution (e.g. launching multiple JVMs?)

  • 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-19T12:38:19+00:00Added an answer on May 19, 2026 at 12:38 pm

    Managing resource and limiting resources is not possible in java. You can prevent malicious code to access system resources (disk/network and so) or the JVM itself but:
    …

    Spawning new threads (so that server resource can be fairly managed!)

    • If i wanna be malicious I am gonna do all my code in the finalizer thread and just block the VM. Same doing protected void finalize(synchronized(Thread.class) {for(;;) LockSupport.park();}} bye-bye new threads.
    • Eating all the memory, eating all direct memory and so on.
    • Accessing zip files in my own jar, and expect ’em getting moved away, so the JVM crashes (due to bug(s) in zlib)

    If one purposely wants to deny resources, it is just not a feasible task to try and catch the hacker. You’d need to know what to search for and dynamically check/enhance the classes on run-time to disallow the behavior.

    Any ability to call methods on objects outside the sandbox, other than the standard Java libraries

    What are the standard libraries? Do you know if/when they must possibly execute some code in a privileged method.


    Each customer – separate VM w/ full restrictions, process affinity/priority, incl max memory/stack and so on.

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

Sidebar

Related Questions

All, I have created a plugin that I will be using across several projects.
all. We're trying to get some intersect collisions working, but the problem experience is
All of my bootstrap code is working except the modal. The Modal shows, but
All I want to do is return the index of the i that is
All my code is here,quite simple,and I don't konw where it goes wrong. Person
All of a sudden, Facebook sharing has stopped working on my site. It's been
All , Say you have a code in a View like this. <img src='@Url.Action(GetCaptchaImg)'
ALL, I have a following code: In .h file: struct Foo { int ma;
All, I have a stored procedure on SQL Server 2005 that accepts an XML
All, We could really do with some advice from SVG gurus. WHAT WE HAVE:

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.