Not using --shell-escape sandboxes pdflatex to some degree. Still, it is perfectly possible for it to, for instance, open and read files, e.g. through \input or Tex primitives such as \read.
Is there a list of Tex primitives and LaTeX macros which, if blacklisted, will prevent pdflatex from reading or writing to files, and more generally will effectively sandbox it? I am especially interested in the case that the tikz or xymatrix packages are used.
Things like \def should presumably be blacklisted, as well as use of packages, and programming constructs like \if and \loop.
On a related note, even if one does not prevent file reading, if one blacklists ../, ~/, /etc/, /home/, and so on, is it possible to prevent pdflatex from leaving the working directory on a linux machine?
securityabove. Bottom line is sandbox another sandbox e.g. per dalief "sort of forks the process, compiles in a child and adds a timer." from https://tex.stackexchange.com/questions/262625/security-latex-injection-hack?noredirect=1&lq=1 – Feb 20 '19 at 15:17