Skip to content

Commit aab9576

Browse files
committed
Adding @csrf tokens to all forms using post method.
1 parent 3c8f160 commit aab9576

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

website/issues/html/file.item.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
tal:attributes="action context/designator"
6767
tal:condition="python:request.user.hasPermission('SB: May Classify')">
6868
69+
<input name="@csrf" type="hidden"
70+
tal:attributes="value python:utils.anti_csrf_nonce()">
6971
<input type="hidden" name="@action" value="spambayes_classify">
7072
<input type="submit" name="trainspam" value="Mark as SPAM" i18n:attributes="value">
7173
<input type="submit" name="trainham" value="Mark as HAM (not SPAM)" i18n:attributes="value">

website/issues/html/msg.item.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676
<input type="hidden" name="@action" value="spambayes_classify">
7777
<input type="submit" name="trainspam" value="Mark as SPAM" i18n:attributes="value">
7878
<input type="submit" name="trainham" value="Mark as HAM (not SPAM)" i18n:attributes="value">
79+
<input name="@csrf" type="hidden"
80+
tal:attributes="value python:utils.anti_csrf_nonce()">
7981
</form>
8082
</th>
8183

website/issues/html/user.forgotten.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<input type="hidden" name="@template" value="forgotten">
3030
<input type="submit" value="Request password reset"
3131
i18n:attributes="value">
32+
<input name="@csrf" type="hidden"
33+
tal:attributes="value python:utils.anti_csrf_nonce()">
3234
</td>
3335
</tr>
3436
</table>
@@ -44,6 +46,8 @@
4446
<tr><td></td><td><input type="submit" value="Request password reset"
4547
i18n:attributes="value"></td></tr>
4648
</table>
49+
<input name="@csrf" type="hidden"
50+
tal:attributes="value python:utils.anti_csrf_nonce()">
4751
</form>
4852

4953
<p i18n:translate="">A confirmation email will be sent to you -

website/issues/html/user.index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
<input type="hidden" name="@template" value="index">
6969
<input type="hidden" name="@action" value="retire">
7070
<input type="submit" value="retire" i18n:attributes="value">
71+
<input name="@csrf" type="hidden"
72+
tal:attributes="value python:utils.anti_csrf_nonce()">
7173
</form>
7274
</td>
7375
</tr>

website/issues/html/user.register.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
<input type="hidden" name="@required" value="username,password,address">
6969
<input type="hidden" name="@action" value="register">
7070
<input type="submit" name="submit" value="Register" i18n:attributes="value">
71+
<input name="@csrf" type="hidden"
72+
tal:attributes="value python:utils.anti_csrf_nonce()">
7173
</td>
7274
</tr>
7375
</table>

0 commit comments

Comments
 (0)