I need to run arbitrary code snippets in Python and Javascript on a server. It cannot be run in the browser.

I'm thinking of sandboxing the code in an AWS Lambda serveless function. However, I'm unsure of the best ways to disable networking (outside of the AWS returning a response over the network) and other potential threats.

How do sites like HackerRank sanitize user submitted code? Is there anything else I should think about?

I've seen answers such as this, but the top rated answers tend to be out of date.

  • 1
    The #2 rated answer to the linked question is quite recent. And the #1 rated answer to that linked question is still valid even today.
    – pepoluan
    Jan 18, 2021 at 15:14


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.