Skip to content

Commit 8aba9c1

Browse files
committed
Added csrf defense to minimal template.
1 parent 67b6e9d commit 8aba9c1

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

share/roundup/templates/minimal/html/_generic.index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
tal:attributes="action context/designator">
4848
<textarea rows="15" style="width:90%" name="rows" tal:content="context/csv"></textarea>
4949
<br>
50+
<input name="@csrf" type="hidden"
51+
tal:attributes="value python:utils.anti_csrf_nonce()">
5052
<input type="hidden" name="@action" value="editCSV">
5153
<input type="submit" value="Edit Items" i18n:attributes="value">
5254
</form>

share/roundup/templates/minimal/html/page.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ <h2><span metal:define-slot="body_title">body title</span></h2>
9494
i18n:attributes="value"><input class="form-small" size="4"
9595
type="text" name="@number">
9696
<input type="hidden" name="@type" value="issue">
97+
<input name="@csrf" type="hidden"
98+
tal:attributes="value python:utils.anti_csrf_nonce()">
9799
<input type="hidden" name="@action" value="show">
98100
</p>
99101
</form>
@@ -129,6 +131,8 @@ <h2><span metal:define-slot="body_title">body title</span></h2>
129131
<b i18n:translate="">Login</b><br>
130132
<input size="10" name="__login_name"><br>
131133
<input size="10" type="password" name="__login_password"><br>
134+
<input name="@csrf" type="hidden"
135+
tal:attributes="value python:utils.anti_csrf_nonce()">
132136
<input type="hidden" name="@action" value="Login">
133137
<input type="checkbox" name="remember" id="remember">
134138
<label for="remember" i18n:translate="">Remember me?</label><br>

share/roundup/templates/minimal/html/user.register.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
<tr>
5858
<td>&nbsp;</td>
5959
<td>
60+
<input name="@csrf" type="hidden"
61+
tal:attributes="value python:utils.anti_csrf_nonce()">
6062
<input type="hidden" name=":action" value="register">
6163
<input type="submit" name="submit" value="Register" i18n:attributes="value">
6264
</td>

0 commit comments

Comments
 (0)