I'm planning to create a service that would allow users to render LaTeX documents online with TeX Live running on the server, and I would like to enable certain features (such as gnuplot) that require --shell-escape.
My question is: Is there a way to enable shell escape in a way that would be secure enough for this purpose?
And also: Are there any other security issues that I should consider when compiling untrusted LaTeX code on a server?
I see that texmf.conf has the following list:
shell_escape_commands = \
bibtex,bibtex8,\
extractbb,\
gregorio,\
kpsewhich,\
makeindex,\
repstopdf,\
r-mpost,\
texosquery-jre8,\
However, I see that gnuplot is not in the list, but I can still run gnuplot when I put \pgfkeys{/pgf/plot/gnuplot call={gnuplot}} in my source, and that seems like a security problem.
--shell-escape– David Carlisle Jun 19 '22 at 11:12--shell-escapeshould only allow command that are listed in the allowed commands list, but gnuplot is not there. – ttsc Jun 19 '22 at 14:59shell-escape. If you use--shell-esacapeyou have full access to any commad you could run on the commd line. – David Carlisle Jun 19 '22 at 15:15--shell-escape, right? – ttsc Jun 19 '22 at 16:47repstopdfandr-mpostin that list are carefully tested wrappers aroundepstopdfand metapost that prevent shell access and prevent reading files in parent directories for exactly this reason. – David Carlisle Jun 19 '22 at 17:10