security trap mode
Johannes Berg <[email protected]>
| Newsgroups | gmane.comp.tex.tetex.general |
|---|---|
| Message-ID | <[email protected]> |
Hi,
As more and more community-style projects incorporate (La)TeX (for
example, planetmath.org), I've been thinking about making this more
secure.
Currently, there are severe input sanitisation bugs with most of these
systems (planetmath.org, wikitex, my own latex2 macro for MoinMoin and
probably others I'm not aware of). This is to say that using (La)TeX a
user can overwrite files, read arbitrary files, abuse computing
resources or fill the harddrive.
I am currently working on a patch (and I have a working version to prove
feasability) that will incorporate a new command into tetex, namely
\securetrap n
where n is an integer. This will turn on a boolean variable inside tetex
(that cannot be turned off again), and consequently will fail all file
opens (be it for reading or writing). Additionally, it allows tetex to
only execute the inner loop for n more iterations. This can be injected
into user input before it is given to TeX (or, more securely, be given
before the user input).
I have two questions about this:
1) from what I read in The TeXbook and the sources, there's no way
to loop in TeX that doesn't take iterations of the main loop. Is
that correct?
2) Is anyone (except me and a couple of people who like to abuse TeX
for the above described) interested in this patch? Ideally I'd like
to discuss the patch with the TeX community for a while and then
finally incorporate it -- it doesn't really add anything unless
you add \securetrap n to a document.
johannes