2008-07-02 22:14:18 +02:00
|
|
|
<TMPL_VAR JAVASCRIPT>
|
2008-07-23 01:58:34 +02:00
|
|
|
<TMPL_VAR MESSAGE>
|
2006-03-12 17:37:26 +01:00
|
|
|
<TMPL_VAR FORM-START>
|
|
|
|
<TMPL_VAR FIELD-DO>
|
Fix CSRF attacks against the preferences and edit forms. Closes: #475445
The fix involved embedding the session id in the forms, and not allowing the
forms to be submitted if the embedded id does not match the session id.
In the case of the preferences form, if the session id is not embedded,
then the CGI parameters are cleared. This avoids a secondary attack where the
link to the preferences form prefills password or other fields, and
the user hits "submit" without noticing these prefilled values.
In the case of the editpage form, the anonok plugin can allow anyone to edit,
and so I chose not to guard against CSRF attacks against users who are not
logged in. Otherwise, it also embeds the session id and checks it.
For page editing, I assume that the user will notice if content or commit
message is changed because of CGI parameters, and won't blndly hit save page.
So I didn't block those CGI paramters. (It's even possible to use those CGI
parameters, for good, not for evil, I guess..)
The only other CSRF attack I can think of in ikiwiki involves the poll plugin.
It's certianly possible to set up a link that causes the user to unknowingly
vote in a poll. However, the poll plugin is not intended to be used for things
that people would want to attack, since anyone can after all edit the poll page
and fill in any values they like. So this "attack" is ignorable.
2008-04-10 22:35:30 +02:00
|
|
|
<TMPL_VAR FIELD-SID>
|
2006-03-12 17:37:26 +01:00
|
|
|
<TMPL_VAR FIELD-FROM>
|
2006-03-19 21:34:59 +01:00
|
|
|
<TMPL_VAR FIELD-RCSINFO>
|
2007-02-24 01:39:06 +01:00
|
|
|
<TMPL_VAR FIELD-NEWFILE>
|
2010-05-07 03:45:17 +02:00
|
|
|
<ol class="form">
|
|
|
|
<TMPL_IF NAME="PAGE_SELECT">
|
|
|
|
<li>
|
|
|
|
<label for="page" class="inline">Page location:</label><TMPL_VAR FIELD-PAGE>
|
|
|
|
<label for="type" class="inline">Page type:</label><TMPL_VAR FIELD-TYPE>
|
|
|
|
</li>
|
2006-03-12 17:37:26 +01:00
|
|
|
<TMPL_ELSE>
|
|
|
|
<TMPL_VAR FIELD-PAGE>
|
2006-07-26 23:23:06 +02:00
|
|
|
<TMPL_VAR FIELD-TYPE>
|
2006-03-12 17:37:26 +01:00
|
|
|
</TMPL_IF>
|
2010-05-07 03:45:17 +02:00
|
|
|
<li>
|
2010-06-10 20:14:46 +02:00
|
|
|
<div class="editcontentdiv">
|
2006-05-27 21:04:46 +02:00
|
|
|
<TMPL_VAR FIELD-EDITCONTENT><br />
|
2010-06-10 20:14:46 +02:00
|
|
|
</div>
|
2010-05-07 03:45:17 +02:00
|
|
|
</li>
|
|
|
|
<TMPL_IF NAME="CAN_COMMIT">
|
|
|
|
<li>
|
|
|
|
<label for="comments" class="block">Optional comment about this change:</label>
|
2006-03-29 05:18:21 +02:00
|
|
|
<TMPL_VAR FIELD-COMMENTS><br />
|
2010-05-07 03:45:17 +02:00
|
|
|
</li>
|
2006-03-12 17:37:26 +01:00
|
|
|
</TMPL_IF>
|
2010-05-07 03:45:17 +02:00
|
|
|
</ol>
|
2007-08-17 07:34:59 +02:00
|
|
|
<TMPL_VAR FORM-SUBMIT>
|
2006-07-02 19:44:43 +02:00
|
|
|
<TMPL_VAR HELPONFORMATTINGLINK>
|
2010-05-07 03:45:17 +02:00
|
|
|
<TMPL_IF NAME="FIELD-ATTACHMENT">
|
2008-07-21 18:15:55 +02:00
|
|
|
<a class="toggle" href="#attachments">Attachments</a>
|
2008-07-02 21:42:32 +02:00
|
|
|
<div class="<TMPL_VAR ATTACHMENTS-CLASS>" id="attachments">
|
|
|
|
<table>
|
2008-07-02 22:08:48 +02:00
|
|
|
<tr><td colspan="5"><TMPL_VAR FIELD-ATTACHMENT><TMPL_VAR FIELD-UPLOAD></td></tr>
|
2010-05-07 03:45:17 +02:00
|
|
|
<TMPL_LOOP NAME="ATTACHMENT_LIST">
|
2008-07-01 23:19:38 +02:00
|
|
|
<tr><td><TMPL_VAR FIELD-SELECT><TMPL_VAR LINK></td><td><TMPL_VAR SIZE></td><td><TMPL_VAR MTIME></td></tr>
|
|
|
|
</TMPL_LOOP>
|
2010-05-07 03:45:17 +02:00
|
|
|
<TMPL_IF NAME="ATTACHMENT_LIST">
|
2008-07-22 04:30:43 +02:00
|
|
|
<tr><td colspan="2"><TMPL_VAR FIELD-LINK><TMPL_VAR FIELD-RENAME><TMPL_VAR FIELD-REMOVE></td></tr>
|
2008-07-01 23:19:38 +02:00
|
|
|
</TMPL_IF>
|
|
|
|
</table>
|
|
|
|
</div>
|
2008-07-01 03:15:19 +02:00
|
|
|
</TMPL_IF>
|
2006-03-12 17:37:26 +01:00
|
|
|
<TMPL_VAR FORM-END>
|
2009-03-08 00:52:14 +01:00
|
|
|
<TMPL_VAR WMD_PREVIEW>
|
2007-07-16 07:24:31 +02:00
|
|
|
|
2010-05-07 03:45:17 +02:00
|
|
|
<TMPL_IF NAME="PAGE_PREVIEW">
|
2006-07-02 19:44:43 +02:00
|
|
|
<hr />
|
2006-05-26 03:42:00 +02:00
|
|
|
<div class="header">
|
2006-05-26 03:10:58 +02:00
|
|
|
<span>Page preview:</span>
|
2006-03-29 09:24:03 +02:00
|
|
|
</div>
|
2007-07-16 07:24:31 +02:00
|
|
|
<div id="preview">
|
2006-03-16 22:39:45 +01:00
|
|
|
<TMPL_VAR PAGE_PREVIEW>
|
2006-03-29 09:24:03 +02:00
|
|
|
</div>
|
2006-03-16 22:39:45 +01:00
|
|
|
</TMPL_IF>
|
2010-05-07 04:19:14 +02:00
|
|
|
<TMPL_IF NAME="PAGE_DIFF">
|
|
|
|
<hr />
|
|
|
|
<div class="header">
|
|
|
|
<span>Diff:</span>
|
|
|
|
</div>
|
|
|
|
<div id="diff">
|
|
|
|
<TMPL_VAR PAGE_DIFF>
|
|
|
|
</div>
|
|
|
|
</TMPL_IF>
|