Skip to content

Commit 6bffb4c

Browse files
committed
[security] Drop |raw on select option text (GHSA-c2q3-p4jr-c55f)
Removed the |raw filter from all four option-text expressions in templates/forms/fields/select/select.html.twig. Option labels — including taxonomy values that propagate cross-page through the admin's shared selection pool — are now autoescaped, so a lower-privileged editor can no longer inject script that runs in an admin's browser when they open any page editor. Bumps to 9.0.1.
1 parent 688cfaf commit 6bffb4c

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# v9.0.1
2+
## 04/23/2026
3+
4+
1. [](#bugfix)
5+
* [security] Fixed stored XSS in select-field option text (GHSA-c2q3-p4jr-c55f). Removed the `|raw` filter from `templates/forms/fields/select/select.html.twig`; option labels — including taxonomy values that propagate cross-page through the admin's shared selection pool — are now autoescaped, so a lower-privileged editor can no longer inject script that runs in an admin's browser when they open any page editor.
6+
17
# v9.0.0
28
## 04/21/20265
39

blueprints.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Form
22
slug: form
33
type: plugin
4-
version: 9.0.0
4+
version: 9.0.1
55
description: Enables forms handling and processing
66
icon: check-square
77
author:

templates/forms/fields/select/select.html.twig

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
{% endfor %}
3535
{% endif %}
3636
>
37-
{% if field.placeholder %}<option value="" disabled selected>{{ field.placeholder|t|raw }}</option>{% endif %}
37+
{% if field.placeholder %}<option value="" disabled selected>{{ field.placeholder|t }}</option>{% endif %}
3838

3939
{% set options = field.options %}
4040
{% if field.selectize.create and value %}
@@ -52,7 +52,10 @@
5252
{{ item_value.label ? 'label=' ~ item_value.label : '' }}
5353
value="{{ akey }}"
5454
>
55-
{{ avalue|raw }}
55+
{# GHSA-c2q3-p4jr-c55f: dropped |raw — option text is now
56+
autoescaped so taxonomy/option values supplied by
57+
lower-privileged editors can no longer inject script. #}
58+
{{ avalue }}
5659
</option>
5760
{% elseif item_value is iterable %}
5861
{% set optgroup_label = item_value|keys|first %}
@@ -62,14 +65,14 @@
6265
{% set item_value = (field.selectize and field.multiple ? suboption : subkey)|string %}
6366
{% set selected = (field.selectize ? suboption : subkey)|string %}
6467
<option {% if subkey is same as (value) or (field.multiple and selected in value) %}selected="selected"{% endif %} value="{{ subkey }}">
65-
{{ suboption|t|raw }}
68+
{{ suboption|t }}
6669
</option>
6770
{% endfor %}
6871
</optgroup>
6972
{% else %}
7073
{% set val = (field.selectize and field.multiple ? item_value : key)|string %}
7174
{% set selected = (field.selectize ? item_value : key)|string %}
72-
<option {% if val is same as (value) or (field.multiple and selected in value) %}selected="selected"{% endif %} value="{{ val }}">{{ item_value|t|raw }}</option>
75+
<option {% if val is same as (value) or (field.multiple and selected in value) %}selected="selected"{% endif %} value="{{ val }}">{{ item_value|t }}</option>
7376
{% endif %}
7477
{% endfor %}
7578

0 commit comments

Comments
 (0)