felixhao28 / JSCPP

A simple C++ interpreter written in JavaScript

Home Page:https://felixhao28.github.io/JSCPP/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is this safe?

vihanb opened this issue · comments

commented

I am wondering if this would be safe to run user-provided code. Excluding denial-of-service attacks e.g. while(1){} it doesn't look like network requests could be made so I'm wondering if this would serve as a safe "sandbox" for running C++ based code.

As far as I know, this project doesn't requires a backend server, all the executions are performed on the user's side. We can prove it by entering JSCPP online and unplug your computer's network cable (close Wi-Fi) after loading. After that, you can still type the C++ code and get the correct result.

So this project won't harm your server by some strange codes. (The user's browser may freeze though...)

Yes. The whole point of this project is to run the code client-side.

if this would serve as a safe "sandbox" for running C++ based code

If your code does not need more features than JSCPP currently has then yes.