Skip to content

Commit 4f6a1f7

Browse files
committed
fix: disable spellchecking for password fields
Some browser can send password to a server for spellchecking. This gives the browser a strong hint that they should not spellcheck a password. Since a Password is not supposed to be a real word in any language, spellchecking is worthless.
1 parent 1c9b8ff commit 4f6a1f7

File tree

13 files changed

+63
-25
lines changed

13 files changed

+63
-25
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ Features:
261261
outstanding bugs against the current classhelper using
262262
current web features. (Patel Malav, Nikunj Thakkar,
263263
Bharath Kanama with integration by John Rouillard)
264+
- disable spellcheck on all password fields to try to prevent
265+
browser from exposing passwords to external servers. (John
266+
Rouillard)
264267

265268
2023-07-13 2.3.0
266269

doc/upgrading.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,41 @@ References:
262262
.. _issue2551282: https://issues.roundup-tracker.org/issue2551282
263263
.. _issue2551115: https://issues.roundup-tracker.org/issue2551115
264264

265+
Disable spellcheck on all password fields (recommended)
266+
-------------------------------------------------------
267+
268+
All tracker templates have been updated to disable spell checking on
269+
password input fields. This can help prevent exposing the password to
270+
an external server that provides spell checking for a browser. Since
271+
passwords should not be real words in any language, spell checking
272+
serves no purpose.
273+
274+
If you have modified your template with a "show password" option you
275+
should disable spell check.
276+
277+
To implement this in your deployed trackers, add::
278+
279+
spellcheck="false"
280+
281+
to make your password inputs look like::
282+
283+
<input type="password" spellcheck="false" name=....>
284+
285+
The changed files in the classic/devel/responsive templates are:
286+
287+
.. code-block:: text
288+
289+
html/page.html
290+
html/user.item.html
291+
292+
and in the jinja2 template the following files were changed:
293+
294+
.. code-block:: text
295+
296+
html/user.item.html
297+
html/user.register.html
298+
html/layout/navigation.html
299+
265300
Add new classhelper to your templates (optional)
266301
------------------------------------------------
267302

share/roundup/templates/classic/html/page.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ <h2><span metal:define-slot="body_title">body title</span></h2>
132132
<p class="userblock">
133133
<b i18n:translate="">Login</b><br>
134134
<input size="10" required name="__login_name"><br>
135-
<input size="10" type="password" required name="__login_password"><br>
135+
<input size="10" spellcheck="false" type="password" required name="__login_password"><br>
136136
<input type="hidden" name="@action" value="Login">
137137
<input type="checkbox" name="remember" id="remember">
138138
<label for="remember" i18n:translate="">Remember me?</label><br>
@@ -376,8 +376,8 @@ <h2><span metal:define-slot="body_title">body title</span></h2>
376376
tal:attributes="id name; name name; value value; readonly not:edit_ok"
377377
value="heinz">
378378
<!-- password: type; no initial value -->
379-
<input metal:define-macro="user_pw_input" type="password"
379+
<input metal:define-macro="user_pw_input" spellcheck="false" type="password"
380380
tal:attributes="id name; name name; readonly not:edit_ok" value="">
381-
<input metal:define-macro="user_confirm_input" type="password"
381+
<input metal:define-macro="user_confirm_input" spellcheck="false" type="password"
382382
tal:attributes="id string:confirm_$name; name string:@confirm@$name; readonly not:edit_ok" value="">
383383

share/roundup/templates/classic/html/user.item.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@
6868
<tal:if condition="edit_ok">
6969
<tr tal:define="name string:password; label string:Login Password">
7070
<th metal:use-macro="th_label">Login Password</th>
71-
<td><input metal:use-macro="pw_input" type="password"></td>
71+
<td><input metal:use-macro="pw_input" spellcheck="false" type="password"></td>
7272
</tr>
7373
<tr tal:define="name string:password; label string:Confirm Password">
7474
<th metal:use-macro="th_label">Confirm Password</th>
75-
<td><input metal:use-macro="confirm_input" type="password"></td>
75+
<td><input metal:use-macro="confirm_input" spellcheck="false" type="password"></td>
7676
</tr>
7777
</tal:if>
7878
<tal:if condition="python:request.user.hasPermission('Web Roles')">

share/roundup/templates/devel/html/page.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ <h1><a href="/">Roundup Demo Tracker</a></h1>
163163
<li>
164164
<tal:span i18n:translate="">Login</tal:span><br/>
165165
<input size="10" required name="__login_name"/><br/>
166-
<input size="10" type="password" required name="__login_password"/><br/>
166+
<input size="10" spellcheck="false" type="password" required name="__login_password"/><br/>
167167
<input name="@csrf" type="hidden"
168168
tal:attributes="value python:utils.anti_csrf_nonce()">
169169
<input type="hidden" name="@action" value="Login"/>
@@ -431,9 +431,9 @@ <h1 id="breadcrumb"><span metal:define-slot="body_title">body title</span></h1>
431431
tal:attributes="id name; name name; value value; readonly not:edit_ok"
432432
value="heinz"/>
433433
<!-- password: type; no initial value -->
434-
<input metal:define-macro="user_pw_input" type="password"
434+
<input metal:define-macro="user_pw_input" spellcheck="false" type="password"
435435
tal:attributes="id name; name name; readonly not:edit_ok" value=""/>
436-
<input metal:define-macro="user_confirm_input" type="password"
436+
<input metal:define-macro="user_confirm_input" spellcheck="false" type="password"
437437
tal:attributes="id string:confirm_$name; name string:@confirm@$name; readonly not:edit_ok" value=""/>
438438

439439
<!-- SHA: ca32e5f43efcb7c3b4940df6f7a176f6990b15f0 -->

share/roundup/templates/devel/html/user.item.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@
6666
<tal:if condition="edit_ok">
6767
<tr tal:define="name string:password; label string:Login Password">
6868
<th metal:use-macro="th_label">Login Password</th>
69-
<td><input metal:use-macro="pw_input" type="password"></td>
69+
<td><input metal:use-macro="pw_input" spellcheck="false" type="password"></td>
7070
</tr>
7171
<tr tal:define="name string:password; label string:Confirm Password">
7272
<th metal:use-macro="th_label">Confirm Password</th>
73-
<td><input metal:use-macro="confirm_input" type="password"></td>
73+
<td><input metal:use-macro="confirm_input" spellcheck="false" type="password"></td>
7474
</tr>
7575
</tal:if>
7676
<tal:if condition="python:request.user.hasPermission('Web Roles')">

share/roundup/templates/jinja2/html/layout/navigation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
<input class="form-control form-control-sm" type='text' required name="__login_name" placeholder='username'>
114114
</li>
115115
<li class="nav-item">
116-
<input class="form-control form-control-sm" type="password" required name="__login_password" placeholder='password'>
116+
<input class="form-control form-control-sm" spellcheck="false" type="password" required name="__login_password" placeholder='password'>
117117
</li>
118118
<li class="nav-item">
119119
<label class="form-control form-control-sm" class='checkbox'>

share/roundup/templates/jinja2/html/user.item.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@
4646
<tr>
4747
<th>{% trans %}Login Password{% endtrans %}</th>
4848
<td>
49-
<input class="form-control" type='password' name='password'>
49+
<input class="form-control" spellcheck='false' type='password' name='password'>
5050
</td>
5151
</tr>
5252
<tr>
5353
<th>{% trans %}Confirm Password{% endtrans %}</th>
5454
<td>
55-
<input class="form-control" type='password' name='@confirm@password'>
55+
<input class="form-control" spellcheck='false' type='password' name='@confirm@password'>
5656
</td>
5757
</tr>
5858
{% endif %}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
<tr>
3333
<th>{% trans %}Login Password{% endtrans %}</th>
3434
<td>
35-
<input type='password' name='password' required>
35+
<input spellcheck='false' type='password' name='password' required>
3636
</td>
3737
</tr>
3838
<tr>
3939
<th>{% trans %}Confirm Password{% endtrans %}</th>
4040
<td>
41-
<input type='password' name='@confirm@password'>
41+
<input spellcheck='false' type='password' name='@confirm@password'>
4242
</td>
4343
</tr>
4444
{% if request.user.hasPermission('Web Roles') %}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ <h2><span metal:define-slot="body_title">body title</span></h2>
130130
<p class="userblock">
131131
<b i18n:translate="">Login</b><br>
132132
<input size="10" required name="__login_name"><br>
133-
<input size="10" type="password" required name="__login_password"><br>
133+
<input size="10" type="password" spellcheck="false" required name="__login_password"><br>
134134
<input name="@csrf" type="hidden"
135135
tal:attributes="value python:utils.anti_csrf_nonce()">
136136
<input type="hidden" name="@action" value="Login">
@@ -338,8 +338,8 @@ <h2><span metal:define-slot="body_title">body title</span></h2>
338338
tal:attributes="id name; name name; value value; readonly not:edit_ok"
339339
value="heinz">
340340
<!-- password: type; no initial value -->
341-
<input metal:define-macro="user_pw_input" type="password"
341+
<input metal:define-macro="user_pw_input" spellcheck="false" type="password"
342342
tal:attributes="id name; name name; readonly not:edit_ok" value="">
343-
<input metal:define-macro="user_confirm_input" type="password"
343+
<input metal:define-macro="user_confirm_input" spellcheck="false" type="password"
344344
tal:attributes="id string:confirm_$name; name string:@confirm@$name; readonly not:edit_ok" value="">
345345

0 commit comments

Comments
 (0)