See https://www.drupal.org/SA-CORE-2014-003
Patch from D7:
diff --git a/includes/form.inc b/includes/form.inc
index 846bcb5..3840885 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -2722,7 +2722,7 @@ function form_select_options($element, $choices = NULL) {
$options = '';
foreach ($choices as $key => $choice) {
if (is_array($choice)) {
- $options .= '<optgroup label="' . $key . '">';
+ $options .= '<optgroup label="' . check_plain($key) . '">';
$options .= form_select_options($element, $choice);
$options .= '</optgroup>';
}
Comment | File | Size | Author |
---|---|---|---|
#5 | 2304965-optgroup-xss-FAIL.patch | 1.79 KB | longwave |
#5 | 2304965-optgroup-xss-PASS.patch | 2.33 KB | longwave |
Comments
Comment #1
klausiComment #2
longwaveComment #3
larowlanassuming bot agrees
Comment #4
klausiI know there is not test case in D7, but we should do it properly here.
Comment #5
longwaveComment #6
larowlanthanks
Comment #8
klausiFailed as expected, back to RTBC.
Comment #9
alexpottCommitted c05668e and pushed to 8.x. Thanks!