Skip to content

Commit

Permalink
Fix two reflected XSS vulnerabilities
Browse files Browse the repository at this point in the history
This removes two cases where input from the query parameter could be reflected back,
without auto-escaping, which resulted in a possible XSS attack surface.

Reported-by: @hexdefined
CVE: CVE-2020-15855
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
  • Loading branch information
puiterwijk authored and cverna committed Nov 30, 2020
1 parent 590ae4d commit 808ff0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 4 additions & 6 deletions bodhi/server/templates/overrides.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h3 class="font-weight-bold m-0 d-flex align-items-center">Overrides
<div class="input-group input-group-sm" data-toggle="dropdown">
<div class="input-group-prepend ml-auto">
<div class="btn btn-sm btn-outline-secondary border" id="overrides-filterslist">

% for param, values in request.params.dict_of_lists().items():
% for i, value in enumerate(values):
% if param in allValidParams:
Expand Down Expand Up @@ -115,7 +115,7 @@ <h3 class="font-weight-bold m-0 d-flex align-items-center">Overrides
<i class="fa fa-times fa-fw text-muted clear-button" data-clear="overrideexpired"></i>
</div>
</div>

<div class="form-group row mb-1 filter-group">
<div class="col-3 align-self-center">
<label for="overridereleases" class="col-auto align-self-center pl-1 pr-0 m-0">Releases:</label>
Expand Down Expand Up @@ -148,7 +148,7 @@ <h3 class="font-weight-bold m-0 d-flex align-items-center">Overrides
<i class="fa fa-times fa-fw text-muted clear-button" data-clear="overridereleases"></i>
</div>
</div>

<div class="form-group row mb-1 filter-group">
<div class="col-3 align-self-center">
<label for="overrideuser" class="col-auto align-self-center pl-1 pr-0 m-0">User:</label>
Expand All @@ -165,7 +165,7 @@ <h3 class="font-weight-bold m-0 d-flex align-items-center">Overrides

<a href="${request.route_url('overrides')}" class="btn btn-link btn-block">Clear Filters</a>
</div>
</div>
</div>
</form></div>
</div>
% endif
Expand All @@ -190,8 +190,6 @@ <h3 class="font-weight-bold m-0 d-flex align-items-center">Overrides
${parent.javascript()}
<script src="${request.static_url('bodhi:server/static/vendor/selectize/selectize-0.12.3.min.js')}"></script>
<script>
var parameters = ${str(request.params.dict_of_lists())|n}
console.log(parameters)
$(document).ready(function() {

var $releases_selectize = $('#overridereleases').selectize();
Expand Down
10 changes: 4 additions & 6 deletions bodhi/server/templates/updates.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ <h3 class="font-weight-bold m-0 d-flex align-items-center">Updates
<div class="input-group input-group-sm" data-toggle="dropdown">
<div class="input-group-prepend ml-auto">
<div class="btn btn-sm btn-outline-secondary border" id="updates-filterslist">

% for param, values in request.params.dict_of_lists().items():
% for i, value in enumerate(values):
% if param in allValidParams:
Expand Down Expand Up @@ -165,7 +165,7 @@ <h3 class="font-weight-bold m-0 d-flex align-items-center">Updates
<i class="fa fa-times fa-fw text-muted clear-button" data-clear="updatereleases"></i>
</div>
</div>

<div class="form-group row mb-1 filter-group">
<div class="col-3 align-self-center">
<label for="updatetypes" class="col-auto align-self-center pl-1 pr-0 m-0">Type:</label>
Expand Down Expand Up @@ -265,7 +265,7 @@ <h3 class="font-weight-bold m-0 d-flex align-items-center">Updates

<a href="${request.route_url('updates')}" class="btn btn-link btn-block">Clear Filters</a>
</div>
</div>
</div>
</form></div>
</div>
% endif
Expand All @@ -290,10 +290,8 @@ <h3 class="font-weight-bold m-0 d-flex align-items-center">Updates
${parent.javascript()}
<script src="${request.static_url('bodhi:server/static/vendor/selectize/selectize-0.12.3.min.js')}"></script>
<script>
var parameters = ${str(request.params.dict_of_lists())|n}
console.log(parameters)
$(document).ready(function() {

var $status_selectize = $('#updatestatus').selectize();
var status_selectize_control = $status_selectize[0].selectize;

Expand Down

0 comments on commit 808ff0d

Please sign in to comment.