Skip to content

Commit 798ef28

Browse files
committed
html/query.item.html was missing checks to verify that a query should
be visible to the user. This is fixed and users can only view queries that they own or that are not private.
1 parent b221ebb commit 798ef28

File tree

5 files changed

+58
-6
lines changed

5 files changed

+58
-6
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,9 @@ Fixed:
457457
- CSRF protection broke the retire function for query edit. Fix
458458
javascript and make sure csrf tokens are provided in the right
459459
places. (John Rouillard)
460+
- query.item.html was missing checks to verify that a query should
461+
be visible to the user. This is fixed and users can only view
462+
queries that they own or that are not private. (John Rouillard)
460463

461464
2016-01-11: 1.5.1
462465

doc/upgrading.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,19 @@ interface. Once in the "Queries I created" section and again in the
518518
"Queries others created" section of the query edit page
519519
(``http..../query?@template=edit``).
520520

521+
Fix security issues in query.item.html template
522+
-----------------------------------------------
523+
The default query.item.html template allows anybody to view all
524+
queries.
525+
526+
This has been updated in the classic, devel and responsive templates
527+
to only allow people to view queries they creates or queries that are
528+
publicly viewable.
529+
530+
If you haven't modified you query.item.html template, simply copy the
531+
query.item.html template from one of the above default templates to
532+
your tracker's html directory.
533+
521534
Enhancement to check command for Permissions
522535
--------------------------------------------
523536

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
<!-- query.item -->
2-
<span tal:replace="structure context/renderQueryForm" />
3-
2+
<span tal:condition="context/is_view_ok" tal:replace="structure
3+
context/renderQueryForm" />
4+
<tal:block tal:condition="not:context/is_view_ok">
5+
<tal:block metal:use-macro="templates/page/macros/icing">
6+
<title metal:fill-slot="head_title">You can not view query</title>
7+
<tal:block metal:fill-slot="body_title">
8+
You can not view query.
9+
</tal:block>
10+
<td class="content" metal:fill-slot="content">
11+
You are not allowed to view <span tal:content="context/_classname"/>
12+
with id <span tal:content="context/id"/>
13+
</td>
14+
</tal:block>
15+
</tal:block>
Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
<!-- query.item -->
2-
<span tal:replace="structure context/renderQueryForm" />
3-
2+
<span tal:condition="context/is_view_ok" tal:replace="structure
3+
context/renderQueryForm" />
4+
<tal:block tal:condition="not:context/is_view_ok">
5+
<tal:block metal:use-macro="templates/page/macros/icing">
6+
<title metal:fill-slot="head_title">You can not view query</title>
7+
<tal:block metal:fill-slot="body_title">
8+
You can not view query.
9+
</tal:block>
10+
<td class="content" metal:fill-slot="content">
11+
You are not allowed to view <span tal:content="context/_classname"/>
12+
with id <span tal:content="context/id"/>
13+
</td>
14+
</tal:block>
15+
</tal:block>
Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
<!-- query.item -->
2-
<span tal:replace="structure context/renderQueryForm" />
3-
2+
<span tal:condition="context/is_view_ok" tal:replace="structure
3+
context/renderQueryForm" />
4+
<tal:block tal:condition="not:context/is_view_ok">
5+
<tal:block metal:use-macro="templates/page/macros/icing">
6+
<title metal:fill-slot="head_title">You can not view query</title>
7+
<tal:block metal:fill-slot="body_title">
8+
You can not view query.
9+
</tal:block>
10+
<td class="content" metal:fill-slot="content">
11+
You are not allowed to view <span tal:content="context/_classname"/>
12+
with id <span tal:content="context/id"/>
13+
</td>
14+
</tal:block>
15+
</tal:block>

0 commit comments

Comments
 (0)