CVE-2014-1691 (published 2014-04-01T15:55Z)

The framework/Util/lib/Horde/Variables.php script in the Util library in Horde before 5.1.1 allows remote attackers to conduct object injection attacks and execute arbitrary PHP code via a crafted serialized object in the _formvars form.

Severity: HIGH
CVSS v2 base score: 7.5 (AV:N/AC:L/Au:N/C:P/I:P/A:P)

Weakness information:
cwe_id: CWE-94
cwe_name: Improper Control of Generation of Code ('Code Injection')
description: The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
extended_description: 
            When a product allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the product. Such an alteration could lead to arbitrary code execution.
            Injection problems encompass a wide variety of issues -- all mitigated in very different ways. For this reason, the most effective way to discuss these weaknesses is to note the distinct features which classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common -- i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed. The most classic instantiations of this category of weakness are SQL injection and format string vulnerabilities.
         
         

Fix information:
repo_url: https://github.com/horde/horde
commit_details: repo_url: https://github.com/horde/horde
author: Michael M Slusarz
author_date: 2013-06-27 09:19:39-06:00
msg: [mms] SECURITY: '_formvars' form input must now be JSON encoded, not PHP serialized.
repository: repo_url: https://github.com/horde/horde
repo_name: horde/horde
description: This is the old, deprecated, monolith Horde repository, archived here for historical reasons.
owner: horde
file_changes: filename: Variables.php
change_type: ModificationType.MODIFY
diff: @@ -61,7 +61,9 @@ class Horde_Variables implements ArrayAccess, Countable, IteratorAggregate
      * Constructor.
      *
      * @param array $vars       The list of form variables (if null, defaults
-     *                          to PHP's $_REQUEST value).
+     *                          to PHP's $_REQUEST value). If '_formvars'
+     *                          exists, it must be a JSON encoded array that
+     *                          contains the list of allowed form variables.
      * @param string $sanitize  Sanitize the input variables?
      */
     public function __construct($vars = array(), $sanitize = false)
@@ -72,7 +74,7 @@ class Horde_Variables implements ArrayAccess, Countable, IteratorAggregate
         }
 
         if (isset($vars['_formvars'])) {
-            $this->_expected = @unserialize($vars['_formvars']);
+            $this->_expected = @json_decode($vars['_formvars'], true);
             unset($vars['_formvars']);
         }
 

programming_language: PHP
filename: package.xml
change_type: ModificationType.MODIFY
diff: @@ -26,8 +26,8 @@
  <date>2013-05-06</date>
  <time>19:34:35</time>
  <version>
-  <release>2.2.3</release>
-  <api>2.2.0</api>
+  <release>2.3.0</release>
+  <api>2.3.0</api>
  </version>
  <stability>
   <release>stable</release>
@@ -35,7 +35,7 @@
  </stability>
  <license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
  <notes>
-* 
+* [mms] SECURITY: &apos;_formvars&apos; form input must now be JSON encoded, not PHP serialized.
  </notes>
  <contents>
   <dir baseinstalldir="/" name="/">
@@ -116,6 +116,9 @@
    <extension>
     <name>iconv</name>
    </extension>
+   <extension>
+    <name>json</name>
+   </extension>
    <extension>
     <name>mbstring</name>
    </extension>
@@ -619,15 +622,15 @@ Converted to package.xml 2.0 for pear.horde.org
   </release>
   <release>
    <version>
-    <release>2.2.3</release>
-    <api>2.2.0</api></version>
+    <release>2.3.0</release>
+    <api>2.3.0</api></version>
    <stability>
     <release>stable</release>
     <api>stable</api></stability>
    <date>2013-05-06</date>
    <license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
    <notes>
-* 
+* [mms] SECURITY: &apos;_formvars&apos; form input must now be JSON encoded, not PHP serialized.
    </notes>
   </release>
  </changelog>

programming_language: PHP