1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-23 23:21:00 +01:00

Fixed RXSS vulnerability in search results

This commit is contained in:
squidfunk 2024-08-19 13:28:56 +02:00
parent 89c1d1cdc5
commit a06cf106ab
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF
5 changed files with 36 additions and 35 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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 %}

View File

@ -20,6 +20,7 @@
* IN THE SOFTWARE.
*/
import escapeHTML from "escape-html"
import { ComponentChild } from "preact"
import { configuration, feature, translation } from "~/_"
@ -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)