Skip to content

Commit

Permalink
Fix cross-site scripting (XSS) vulnerability in handling SVG animate …
Browse files Browse the repository at this point in the history
…attributes

Reported by Valentin T. and Lutz Wolf of CrowdStrike.
  • Loading branch information
alecpl committed May 19, 2024
1 parent cde4522 commit 43aaaa5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Fix missing field labels in CSV import, for some locales (#9393)
- Fix command injection via crafted im_convert_path/im_identify_path on Windows
- Fix cross-site scripting (XSS) vulnerability in handling list columns from user preferences
- Fix cross-site scripting (XSS) vulnerability in handling SVG animate attributes

## Release 1.6.6

Expand Down
2 changes: 1 addition & 1 deletion program/lib/Roundcube/rcube_washtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ private static function attribute_value($node, $attr_name, $attr_value)

foreach ($node->attributes as $name => $attr) {
if (strtolower($name) === $attr_name) {
if (strtolower($attr_value) === strtolower($attr->nodeValue)) {
if (strtolower($attr_value) === strtolower(trim($attr->nodeValue))) {
return true;
}
}
Expand Down
4 changes: 4 additions & 0 deletions tests/Framework/Washtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,10 @@ function data_wash_svg_tests()
. 'ZWY9IngiIG9uZXJyb3I9ImFsZXJ0KCcxJykiLz48L3N2Zz4=#x"></svg></html>',
'<svg><use x-washed="href"></use></svg>'
],
[
'<html><svg><animate attributeName="href " values="javascript:alert(\'XSS\')" href="#link" /></animate></svg></html>',
'<svg><!-- animate blocked --></svg>',
],
];
}

Expand Down

0 comments on commit 43aaaa5

Please sign in to comment.