]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/plugins/contrib/compile/discussion.mdwn
typos
[git.ikiwiki.info.git] / doc / plugins / contrib / compile / discussion.mdwn
1 This plugin sounds exactly like what I need! I too have sources I want to compile on the fly,
2 such as diagrams made with Dia and perhaps API reference manuals made with Doxygen.
4 I'd like to use it, but -
6 Problem: Any user can change the command to something dangerous that deletes file and
7 causes irreversible damage to the system. I can even happen by mistake.
9 Suggestion: Add an option to the setup file that forbids to override the build command in the
10 directive, and then only the setup file can configure build commands (if you want). Another
11 idea, an option to validate the build command, either against a regex or using an arbitrary
12 script specified in setup file - then e.g. you can choose which commands are allowed.
14 What do you think?
16 -- [[fr33domlover]]
18 > The problem you mention is known, and is not a problem for me, since I am the
19 only user of the wiki. However, if we need a *secure* version of this
20 command...
21 >
22 > Imagine we have a setup option `compile_unsecure`.
23 >
24 > The directive takes the following arguments 
25 >
26 > - filetype: No problem.
27 > - build: Forbidden.
28 > - source: No problem.
29 > - template: No problem.
30 > - destname and files: The problem is that right now, the command is run using a shell
31 >   call. Thus, a user can easily use this argument to inject malicious
32 >   commands (something like \[[!compile files=";rm -fr *"]] (well, this
33 >   actually would not work, but you get the idea)). I do want to keep the
34 >   ability to use shell commands, for the flexibility it provides, but I imagine
35 >   we can:
36 >   - interpret the `build` command depending on its type:
37 >     - if it is a string, it is interpreted as a shell command;
38 >     - if it is a list of strings, the first one is the command to execute,
39 >       the following ones are the arguments. If I am not wrong, this should
40 >       prevent command injection.
41 >     - if it is a list of lists of strings, it is a list of commands to
42 >       execute (execution being stopped on the first error; usefull for stuff
43 >       like `latex foo.tex && dvipdf foo.dvi`).
44 >   - the `compile_unsecure` would:
45 >     - forbid commands to be strings (thus, forbidding shell commands, and preventing command injections);
46 >     - forbid compilation using Makefile or executable present in the wiki (to prevent users from modifying those files, and executing arbitrary commands);
47 >     - forbid directive argument `build`.
48 >
49 >
50 > Any thoughts?
51 >
52 > -- [[Louis|spalax]]