Skip to content

Commit

Permalink
[BUGFIX:BP:11.5] Sanitize frequent and last searches output
Browse files Browse the repository at this point in the history
Wraps output of frequent searches and last searches in
format.htmlentities, to prevent XSS. In rare scenarios
there might be issues with unsanitized output of frequent
searches and/or last searches, this issues are now solved.

The StatisticsWriterProcessor is already sanitizing the stored
terms, but as it's possible to use any custom table it should be
ensured the data is sanitized.

If last searches is activated and configured for global mode,
there might be issues too. Though it's required that the prepared
query delivers result documents, as EXT:solr will only store the
terms if results are found, the output should be sanitized too.

Ports: #3590
Resolves: #3589
  • Loading branch information
dkd-friedrich committed Apr 5, 2023
1 parent 85994a6 commit 47b2b0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Resources/Private/Partials/Search/FrequentlySearched.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ul class="list-group list-group-flush collapse show" id="frequendSearches">
<f:for each="{frequentSearches}" as="searchedForInfo">
<li class="list-group-item {searchedForInfo.class}">
<a href="{s:uri.search.startNewSearch(queryString: searchedForInfo.q)}" class="solr-ajaxified">{searchedForInfo.q}</a>
<a href="{s:uri.search.startNewSearch(queryString: searchedForInfo.q)}" class="solr-ajaxified"><f:format.htmlentities>{searchedForInfo.q}</f:format.htmlentities></a>
</li>
</f:for>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/Search/LastSearches.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<ul class="list-group collapse show" id="lastSearches">
<f:for each="{lastSearches}" as="searchedFor">
<li class="list-group-item">
<a href="{s:uri.search.startNewSearch(queryString: searchedFor)}" class="solr-ajaxified">{searchedFor}</a>
<a href="{s:uri.search.startNewSearch(queryString: searchedFor)}" class="solr-ajaxified"><f:format.htmlentities>{searchedFor}</f:format.htmlentities></a>
</li>
</f:for>
</ul>
Expand Down

0 comments on commit 47b2b0f

Please sign in to comment.