I'm building a webapp that takes latex code from users, which is then compiled serverside. Now latex creates a huge system vulnerability since it is turing complete and you can basically hack the entire system by using commands like \openin, \read, \readline or \write.
I've read the articles tagged with security, but I'm not sure yet what is necessary to make the system entirely safe. E.g. it says change the
texmf.cnf file. But then in one of the comments it says:
Be aware that a malicious loop could spike the CPU indefinitely. (Dave Jarvis)
A solution for this is not presented. What can be done about this? But so my concrete question is:
Which measures are necessary to make my web page secure, when compiling user latex?