CVE-2015-8766: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79)
value: 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.
CWE description: The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
CVSS v3 base score: 6.1
Published: 2016-01-08T21:59Z
Repository: https://github.com/symphonycms/symphony-2
Language: PHP
Files changed: symphony/content/content.systempreferences.php
Commit date: 2015-11-05 22:55:45 +1000
Commit message: Sanitize the POST for the system/preferences/

Diff: diff --git a/symphony/content/content.systempreferences.php b/symphony/content/content.systempreferences.php
index c3019b10d..a1cf73d59 100644
--- a/symphony/content/content.systempreferences.php
+++ b/symphony/content/content.systempreferences.php
@@ -194,11 +194,11 @@ class contentSystemPreferences extends AdministrationPage
          * '/system/preferences/'
          */
         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`
              * Allows extensions to preform custom validation logic on the settings.
              *
@@ -208,11 +208,14 @@ class contentSystemPreferences extends AdministrationPage
              * @param array $settings
              *  An array of the preferences to be saved, passed by reference
              * @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)) {
                     Symphony::Configuration()->setArray($settings, false);
                 }

Vulnerable code:             $settings = $_POST['settings'];
            Symphony::ExtensionManager()->notifyMembers('Save', '/system/preferences/', array('settings' => &$settings, 'errors' => &$this->_errors));
Fixed code:             $settings = filter_var_array($_POST['settings'], FILTER_SANITIZE_STRING);
            Symphony::ExtensionManager()->notifyMembers('Save', '/system/preferences/', array(
                'settings' => &$settings,
                'errors' => &$this->_errors
            ));