foo
[ikiwiki.git] / doc / security.mdwn
1 Let's do an ikiwiki security analysis..
2
3 If you are using ikiwiki to render pages that only you can edit, then there
4 are no more security issues with this program than with cat(1). If,
5 however, you let others edit pages in your wiki, then some security issues
6 do need to be kept in mind.
7
8 ## html attacks
9
10 ikiwiki does not attempt to do any santization of the html on the wiki.
11 MarkDown allows embedding of arbitrary html into a markdown document. If
12 you let anyone else edit files on the wiki, then anyone can have fun exploiting
13 the web browser bug of the day. This type of attack is typically referred
14 to as an XSS attack ([google](http://www.google.com/search?q=xss+attack)).
15
16 ## image files etc attacks
17
18 If it enounters a file type it does not understand, ikiwiki just copies it
19 into place. So if you let users add any kind of file they like, they can
20 upload images, movies, windows executables, etc. If these files exploit
21 security holes in the browser of someone who's viewing the wiki, that can
22 be a security problem.
23
24 ## exploting ikiwiki with bad content
25
26 Someone could add bad content to the wiki and hope to exploit ikiwiki.
27 Note that ikiwiki runs with perl taint checks on, so this is unlikely;
28 the only data that is not subject to full taint checking is the names of
29 files, and filenames are sanitised.
30
31 ## cgi scripts
32
33 ikiwiki does not allow cgi scripts to be published as part of the wiki. Or
34 rather, the script is published, but it's not marked executable, so
35 hopefully your web server will not run it.
36
37 ## web server attacks
38
39 If your web server does any parsing of special sorts of files (for example,
40 server parsed html files), then if you let anyone else add files to the wiki,
41 they can try to use this to exploit your web server.
42
43 ## --gen-wrapper might generate insecure wrappers
44
45 ikiwiki --gen-wrapper is intended to generate a wrapper program that
46 runs ikiwiki to update a given wiki. The wrapper can in turn be made suid,
47 for example to be used in a [[post-commit]] hook by people who cannot write
48 to the html pages, etc.
49
50 If the wrapper script is made suid, then any bugs in this wrapper would be
51 security holes. The wrapper is written as securely as I know how and
52 there's been no problem yet.