Skip to content

Commit

Permalink
Fixed RXSS vulnerability in search results
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Aug 19, 2024
1 parent 89c1d1c commit a06cf10
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 35 deletions.
29 changes: 0 additions & 29 deletions material/templates/assets/javascripts/bundle.20f8b5b3.min.js

This file was deleted.

29 changes: 29 additions & 0 deletions material/templates/assets/javascripts/bundle.471ce7a9.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.20f8b5b3.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.471ce7a9.min.js' | url }}"></script>
{% for script in config.extra_javascript %}
{{ script | script_tag }}
{% endfor %}
Expand Down
3 changes: 2 additions & 1 deletion src/templates/assets/javascripts/templates/search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* IN THE SOFTWARE.
*/

import escapeHTML from "escape-html"
import { ComponentChild } from "preact"

import { configuration, feature, translation } from "~/_"
Expand Down Expand Up @@ -60,7 +61,7 @@ function renderSearchDocument(
const missing = Object.keys(document.terms)
.filter(key => !document.terms[key])
.reduce<ComponentChild[]>((list, key) => [
...list, <del>{key}</del>, " "
...list, <del>{escapeHTML(key)}</del>, " "
], [])
.slice(0, -1)

Expand Down

0 comments on commit a06cf10

Please sign in to comment.