Security risks in web based scientific computing
Pretty much every science software company has spun off a web version their products. But there is something odd about many of them - there is no sign of them on the makers websites. Sure there are pages of prose and pretty pictures telling you about them, but rarely any live demo. No chance to interact with an example deployment. It seems obvious that this would be the best way to showcase or trial such products.
And so it is with the Matlab Web Server that I was researching when this fact dawned on me. It's not that Mathworks doesn't consider its website to be an important part of its business and promotion. Then it occured to me that it might be because their website is important to them that they have no live demo.
The architecture of the system is: The web browser connects to a TCP/IP client "matweb", on the server that passes all requests to the matlabserver that connects to Matlab where the task is computed. So the matlab server is exposed to full scrutiny of the internet community, including the unfriendly ones.
There is a great power struggle going on out there between security companies and the hackers. With mighty companies like Microsoft and real experts like The Apache Foundation struggling to keep up with the latest tricks of the enemy. Would you trust the security of your web server made to a company who's expertise is not in security? Well it looks like neither would Mathworks!
Perhaps this is paranoid, but when you look at the documentation for the Matlab Web Server, there does not appear to be even a mention of security, let alone any serious instruction.
Since most scientific software are essentially programming languages, they are very dangerous to give unrestricted access to. You must block two levels of access:
First you must control the tasks that the user requests to get computed (Matlab, like most other languages, can be instructed to delete files, launch programs like telnet daemons, or copy and send files such as your password file).
Second you must make sure that you are opening a door only to the application that you intended.
One line of the documentation that interested me was:
"observe that the line
<input name="mlmfile" value="webmagic" type="hidden">
sets argument mlmfile to the value webmagic. The mlmfile argument contains the name of the MATLAB M-file to run."
So the choice of what program to run is visible in the page source! Sure enough, if you find some user's pages and do "Show source" you can see this "hidden" field in the HTML. This means that I can instruct that user's Matlab to run any .m file that I can predict to exist on his server, just by copying the HTML and editing that line and opening it in a browser. Now hands up who knows the matlab installation and most popular addons well enough to know which could be misused if malicious user could run them? Also, if I can place a file on the server by some other exploit, I now have a way to execute it. I'm sure a real hacker would have plenty of ideas.
If you are considering any other web based deployment system for a language, a good test might be to see if the supplier trusts it enough to run on their own websites.







