Mailing List Archive

TeX security
Neil wrote:

>We should also be really cautious about TeX doing insecure things. Is
>there a subset of TeX syntax we could parse and validate before we
>pass it to TeX?

There are two dangerous commands in TeX: the ability to write to
arbitrary files, and the ability to call shell scripts. Both are
disabled in all standard TeX distributions. Parsing and validating is
thus not necessary (and next to impossible without reimplementing a
good chunk of TeX). We have to start TeX in a temporary directory
which is cleaned out afterwards, and we have to guard against
run-away TeX processes which eat time and/or memory. The TeX process
needs to have its resources limited.

See also the discussion at http://groups.google.com/groups?threadm=d55ab765.0111091929.1e4b9af4%40posting.google.com&rnum=1

Axel
TeX security [ In reply to ]
I just realized that TeX by default can also read all files on the
system that the process has permissions to read, and we may want to
restrict that; this is done with the line
openin_any = p
in the file texmf.cf.

Axel