If one runs SocketListen
on a Virtual Private Server (VPS), in principle one can set up a webpage with the Wolfram Language as a back-end.
For instance, with wolfram-server and a html client, one modifies the IP addresses of both the server and the client to the public IP of the VPS and voilà, you have a webpage that sends commands to a wolfram engine installed on the VPS.
Then let's say one publishes that webpage; at that point I could read the source code of that HTML page and see the IP and port of the socket utilized by the server, so that now I could make the wolfram engine on that VPS to execute any code I want! Basically I would have full control of one's VPS.
So, how to set up a secured wolfram back-end?
I want the wolfram engine installed on my VPS to execute only the specific commands requested by the webpage, but until I have a SocketListen
running on my VPS anyone could send any command to it.
One solution could be to evaluate ToExpression@#["Data"]&
as a SocketListen
function only if the string #["Data"]
matches a given pattern, but I suspect one can write a string that satisfies any pattern and eventually insert something malicious anyway.
Thanks
f
that takes the slider value as argument. How do I definef
to do not evaluate generic commands? $\endgroup$