Question

Say I have a web site where people can upload their code in class form. How could I limit what can actually be done within that class?

Was it helpful?

Solution

Implement a SecurityManager1 for the client code. I would also recommend testing how long the code runs, and ending it if over a limit (this is more aimed at catching programmer incompetence that leads to an infinite loop, rather than deliberately malicious actions).

  1. E.G. as seen in this answer which aims to achieve Preventing System.exit() from API.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top