6

I'm making a certain program, which is calling LaTeX. I'm thinking that this program can include only one style file.

My question is "can we write destructive code in style file?". For example, can we write code for removing file or system?

8

Yes:

  • TeX can open files for writing and therefore overwrite files. Depending on the TeX distribution, there might be some security restrictions (no files in parent directories, ...).

  • There is a shell escape feature (also called "write18"), which can be used for malicious code. Again, there are some security restrictions. For example, TeX Live only enables restricted shell escape, which only allows a small list of configured programs (e.g. kpsewhich, makeindex) to run.

  • Thx. I'll research some more deeply about write18 or restructed. – yassu Sep 23 '14 at 4:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.