summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-01-13 09:41:41 +0100
committerAleksander Machniak <alec@alec.pl>2015-01-13 09:41:41 +0100
commit786aa0725e28976bed5037814e01c44c90a551f5 (patch)
tree32b9da3074dbced5f29f57f378858d1a60afb458 /program/lib/Roundcube
parentd204814a39509a9709f9e4cb60ef52ff501d530d (diff)
Fix XSS issue in style attribute handling (#1490227)
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r--program/lib/Roundcube/rcube_washtml.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_washtml.php b/program/lib/Roundcube/rcube_washtml.php
index 4bf189e99..e0cce685b 100644
--- a/program/lib/Roundcube/rcube_washtml.php
+++ b/program/lib/Roundcube/rcube_washtml.php
@@ -244,8 +244,8 @@ class rcube_washtml
$t .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES) . '"';
}
else if ($key == 'style' && ($style = $this->wash_style($value))) {
- $quot = strpos($style, '"') !== false ? "'" : '"';
- $t .= ' style=' . $quot . $style . $quot;
+ // replace double quotes to prevent syntax error and XSS issues (#1490227)
+ $t .= ' style="' . str_replace('"', '&quot;', $style) . '"';
}
else if ($key == 'background'
|| ($key == 'src' && preg_match('/^(img|source)$/i', $node->tagName))