Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:29909
HistoryOct 09, 2013 - 12:00 a.m.

[KIS-2013-09] Vanilla Forums <= 2.0.18.5 (class.utilitycontroller.php) PHP Object Injection Vulnerability

2013-10-0900:00:00
vulners.com
32

Vanilla Forums <= 2.0.18.5 (class.utilitycontroller.php) PHP Object Injection Vulnerability

[-] Software Link:

http://vanillaforums.org/

[-] Affected Versions:

All versions from 2.0 to 2.0.18.5.

[-] Vulnerability Description:

The vulnerable code is located in /applications/dashboard/controllers/class.utilitycontroller.php:

  1.      // Get the message, response, and transientkey
    
  2.      $Messages = TrueStripSlashes&#40;GetValue&#40;&#39;Messages&#39;, $_POST&#41;&#41;;
    
  3.      $Response = TrueStripSlashes&#40;GetValue&#40;&#39;Response&#39;, $_POST&#41;&#41;;
    
  4.      $TransientKey = GetIncomingValue&#40;&#39;TransientKey&#39;, &#39;&#39;&#41;;
    
  5.      // If the key validates
    
  6.      $Session = Gdn::Session&#40;&#41;;
    
  7.      if &#40;$Session-&gt;ValidateTransientKey&#40;$TransientKey&#41;&#41; {
    
  8.         // If messages wasn&#39;t empty
    
  9.         if &#40;$Messages != &#39;&#39;&#41; {
    
  10.            // Unserialize them &amp; save them if necessary
    
  11.            $Messages = Gdn_Format::Unserialize&#40;$Messages&#41;;
    

[…]

  1.         // If the response wasn&#39;t empty, save it in the config
    
  2.         if &#40;$Response != &#39;&#39;&#41;
    
  3.            $Save[&#39;Garden.RequiredUpdates&#39;] = Gdn_Format::Unserialize&#40;$Response&#41;;
    

User input passed through the "Messages" and "Response" POST parameters is not properly sanitized
before being used in a call to the "Gdn_Format::Unserialize" method at lines 327 and 360. This can
be exploited to inject arbitrary PHP objects into the application scope, that could allow an attacker
to conduct Local File Inclusion attacks by abusing the "Gdn_Module::__toString" method, which triggers
a call to the "Gdn_Module::FetchView" method:

  1.   public function FetchView&#40;&#41; {
    
  2.      $ViewPath = $this-&gt;FetchViewLocation&#40;&#41;;
    
  3.      $String = &#39;&#39;;
    
  4.      ob_start&#40;&#41;;
    
  5.      if&#40;is_object&#40;$this-&gt;_Sender&#41; &amp;&amp; isset&#40;$this-&gt;_Sender-&gt;Data&#41;&#41; {
    
  6.         $Data = $this-&gt;_Sender-&gt;Data;
    
  7.      } else {
    
  8.         $Data = array&#40;&#41;;
    
  9.      }
    
  10.      include &#40;$ViewPath&#41;;
    

The value returned by the "Gdn_Module::FetchViewLocation" method at line 112 can be controlled by the
"_ApplicationFolder" object's property, which results in an arbitrary local file inclusion at line 120.
Successful exploitation of the vulnerability using this vector requires the application running on
PHP < 5.3.4, because it needs a null-byte injection attack. However, other attack vectors might
be possible, e.g. leveraging magic methods of classes defined in third-party components.

[-] Solution:

Update to version 2.0.18.6 or higher.

[-] Disclosure Timeline:

[02/03/2013] - Vendor notified
[22/03/2013] - Version 2.0.18.6 released: http://git.io/7EXdpQ
[10/05/2013] - CVE number assigned
[07/10/2013] - Public disclosure

[-] CVE Reference:

The Common Vulnerabilities and Exposures project (cve.mitre.org)
has assigned the name CVE-2013-3528 to this vulnerability.

[-] Credits:

Vulnerability discovered by Egidio Romano.

[-] Original Advisory:

http://karmainsecurity.com/KIS-2013-09