Vulnerability: Multiple cross-site scripting (XSS) vulnerabilities in content/content.systempreferences.php in Symphony CMS before 2.6.4 allow remote attackers to inject arbitrary web script or HTML via the (1) email_sendmail[from_name], (2) email_sendmail[from_address], (3) email_smtp[from_name], (4) email_smtp[from_address], (5) email_smtp[host], (6) email_smtp[port], (7) jit_image_manipulation[trusted_external_sites], or (8) maintenance_mode[ip_whitelist] parameters to system/preferences.
Vulnerability ID: CVE-2015-8766
CWE: CWE-79
Severity score: 2.9
Project: https://github.com/symphonycms/symphony-2
Published: 2016-01-08
File: symphony/content/content.systempreferences.php
Commit message: Sanitize the POST for the system/preferences/
Commit author: Brendan Abbott

Vulnerable version (before fix):
 public function action()         Symphony::ExtensionManager()->notifyMembers('CustomActions', '/system/preferences/');          if (isset($_POST['action']['save'])) {             $settings = $_POST['settings'];              /**              * Just prior to saving the preferences and writing them to the `CONFIG` public function action()              * @param array $errors              *  An array of errors passed by reference              */             Symphony::ExtensionManager()->notifyMembers('Save', '/system/preferences/', array('settings' => &$settings, 'errors' => &$this->_errors));              if (!is_array($this->_errors) || empty($this->_errors)) {                 if (is_array($settings) && !empty($settings)) {

Fixed version (after fix):
 public function action()         Symphony::ExtensionManager()->notifyMembers('CustomActions', '/system/preferences/');          if (isset($_POST['action']['save'])) {             $settings = filter_var_array($_POST['settings'], FILTER_SANITIZE_STRING);              /**              * Just prior to saving the preferences and writing them to the `CONFIG` public function action()              * @param array $errors              *  An array of errors passed by reference              */             Symphony::ExtensionManager()->notifyMembers('Save', '/system/preferences/', array(                 'settings' => &$settings,                 'errors' => &$this->_errors             ));              if (!is_array($this->_errors) || empty($this->_errors)) {                 if (is_array($settings) && !empty($settings)) {

Patch:
patch: @@ -196,7 +196,7 @@ public function action()
         Symphony::ExtensionManager()->notifyMembers('CustomActions', '/system/preferences/');
 
         if (isset($_POST['action']['save'])) {
-            $settings = $_POST['settings'];
+            $settings = filter_var_array($_POST['settings'], FILTER_SANITIZE_STRING);
 
             /**
              * Just prior to saving the preferences and writing them to the `CONFIG`
@@ -210,7 +210,10 @@ public function action()
              * @param array $errors
              *  An array of errors passed by reference
              */
-            Symphony::ExtensionManager()->notifyMembers('Save', '/system/preferences/', array('settings' => &$settings, 'errors' => &$this->_errors));
+            Symphony::ExtensionManager()->notifyMembers('Save', '/system/preferences/', array(
+                'settings' => &$settings,
+                'errors' => &$this->_errors
+            ));
 
             if (!is_array($this->_errors) || empty($this->_errors)) {
                 if (is_array($settings) && !empty($settings)) {
path: symphony/content/content.systempreferences.php