code review of hnd plugin
[ikiwiki.git] / doc / plugins / contrib / hnb / discussion.mdwn
1 I've reviewed this plugin's code, and there is one major issue with it,
2 namely this line:
3
4         system("hnb '$params{page}.hnb' 'go root' 'export_html $tmp' > /dev/null");
5
6 This could potentially allow execution of artibtary shell code, if the filename
7 contains a single quote. Which ikiwiki doesn't allow by default, but I prefer
8 to never involve a shell where one is not needed. The otl plugin is a good
9 example of how to safely fork a child process without involving the shell.
10
11 Other problems:
12
13 * Use of shell mktemp from perl is suboptimal. File::Temp would be better.
14 * The htmlize hook should not operate on the contents of `$params{page}.hnb`.
15   The content that needs to be htmlized is passed in to the hook in
16   `$params{content}`.
17
18 If these problems are resolved and a copyright statement is added to the file,
19 I'd be willing to include this plugin in ikiwiki. --[[Joey]]