]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/__42__forward__42__ing_functionality_for_the_meta_plugin.mdwn
move from bugs to todo
[ikiwiki.git] / doc / todo / __42__forward__42__ing_functionality_for_the_meta_plugin.mdwn
1 Here is a patch [[tag patch]] to add a *forward*ing functionality
2 to the [[`meta`_plugin|plugins/meta]].
3
4 > [[done]], with some changes --[[Joey]]
5
6 Find the most recent version at
7 <http://www.schwinge.homeip.net/~thomas/tmp/meta_forward.patch>.
8
9 I can't use `scrub(...)`, as that will strip out the forwarding HTML command.
10 How to deal with that?
11
12 I can also submit a Git patch, if desired.
13
14
15 # Syntax
16
17 **URL** = http://some.nice/place/ (*etc.*)
18
19 **WHITHER** = \[\[**[[ikiwiki/wikilink]]**]] | **URL**
20
21 **D** = natural number (*meaning seconds*)
22
23 **OPT_DELAY** = delay=**D** | empty (*immediatelly*)
24
25 \[[meta forward="**WHITHER**" **OPT_DELAY**]]
26
27
28 # Extensions and Ideas
29
30 It might be doable to add references to pages that refer to the page containg
31 the forwarding statement also to the referred-to page.
32
33 --[[tschwinge]]
34
35
36 # Discussion
37
38 > The html scrubber cannot scrub meta headers. So if you emit one
39 > containing user-supplied data, it's up to you to scrub it to avoid all
40 > possible XSS attacks. Two attacks I'd worry about are cyclic meta refresh
41 > loops, which some, but not all web browsers detect and break, and any way
42 > to insert javascript via the user-supplied parameters. (Ie, putting
43 > something in the delay value that closes the tag can probably insert
44 > javascript ATM; and are there ways to embed javascript in the url?)
45 > --[[Joey]]
46
47 >> OK.  I can add code to make sure that `$delay` **D** indeed is a natural number
48 >> and that the passed target address **WHITHER** is nothing but a valid target address.
49 >> (How to qualify a valid target address?)
50 >> What is a *cyclic meta refresh loop*?  Two pages in turn forwarding to each other?
51 >> I think it would be possible to implement such a guard when only in-wiki links
52 >> ([[ikiwiki/wikilink]]s) are being used, but how to do so for external links?  --[[tschwinge]]
53
54 >>> This seems a lot more securely to do for in-wiki links, since we know
55 >>> that a link generated by a wikilink is safe, and can avoid cycles.
56 >>> Obviously there's no way to avoid cycles when using external links.
57 >>> 
58 >>> An example of code that doesn't detect such cycles is LWP::UserAgent,
59 >>> which will happily follow cycles forever. There's a LWPx::ParanoidAgent
60 >>> that can deal with cycles. I suppose this could be considered a client
61 >>> side issue, except that if I were going to turn this redirect feature
62 >>> on in my wikis, I'd really prefer to not have to worry about my wiki
63 >>> causing such problems for clients. I feel it makes sense to make
64 >>> external redirects or other potentially unsafe things an option,
65 >>> and have the default behavior be only things that are known to be
66 >>> secure.
67 >>>
68 >>> I haven't checked if there's a way to embed javascript in meta refresh
69 >>> links or not. Given all the other places I've seen it be embedded, I'll
70 >>> assume it is possible until it's shown not to be though.. --[[Joey]]