Lucene search
K

Piwik 2.16.0 PHP Object Injection

🗓️ 08 Nov 2016 00:00:00Reported by EgiXType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 41 Views

Piwik PHP Object Injection vulnerability in version 2.16.0 and prior allows unauthenticated attackers to inject PHP objects through the "layout" request parameter, leading to Server-Side Request Forgery (SSRF) attacks, file deletion, and arbitrary code execution

Code
`---------------------------------------------------------------  
Piwik <= 2.16.0 (saveLayout) PHP Object Injection Vulnerability  
---------------------------------------------------------------  
  
  
[-] Software Link:  
  
https://piwik.org/  
  
  
[-] Affected Versions:  
  
Version 2.16.0 and prior versions.  
  
  
[-] Vulnerability Description:  
  
The vulnerability can be triggered through the saveLayout() method   
defined in /plugins/Dashboard/Controller.php:  
  
210. public function saveLayout()  
211. {  
212. $this->checkTokenInUrl();  
213.  
214. $layout =   
Common::unsanitizeInputValue(Common::getRequestVar('layout'));  
215. $layout = strip_tags($layout);  
216. $idDashboard = Common::getRequestVar('idDashboard', 1, 'int');  
217. $name = Common::getRequestVar('name', '', 'string');  
218.  
219. if (Piwik::isUserIsAnonymous()) {  
220. $session = new SessionNamespace("Dashboard");  
221. $session->dashboardLayout = $layout;  
222. $session->setExpirationSeconds(1800);  
  
User input passed by anonymous users through the "layout" request   
parameter is being stored into  
a session variable at line 221, and this is possible by invoking an URL   
like this:  
  
http://[piwik]/index.php?module=Dashboard&action=saveLayout&token_auth=anonymous&layout=[injection]%26%2365536;  
  
Since Piwik is not using "utf8mb4" collations for its database, this can   
be exploited in combination with a MySQL  
UTF8 truncation issue in order to corrupt the session array, allowing   
unauthenticated attackers to inject arbitrary  
PHP objects into the application scope and carry out Server-Side Request   
Forgery (SSRF) attacks, delete arbitrary  
files, execute arbitrary PHP code, and possibly other attacks.   
Successful exploitation of this vulnerability  
requires Piwik to use the database to store session data (dbtable   
option) and the application running on  
PHP before version 5.4.45, 5.5.29, or 5.6.13.  
  
  
[-] Solution:  
  
Update to version 2.16.1 or later.  
  
  
[-] Disclosure Timeline:  
  
[08/02/2016] - Vendor notified  
[09/02/2016] - Vendor replied not to be able to reproduce the issue  
[11/02/2016] - Proof of concept tested on demo.piwik.org sent to the vendor  
[11/02/2016] - Vendor response stating the issue will be fixed in 2.16.1   
release  
[17/02/2016] - Bug bounty received  
[11/04/2016] - Version 2.16.1 released:   
http://piwik.org/changelog/piwik-2-16-1/  
[16/06/2016] - CVE number requested  
[07/11/2016] - Public disclosure  
  
  
[-] CVE Reference:  
  
The Common Vulnerabilities and Exposures project (cve.mitre.org)  
has not assigned a CVE identifier for this vulnerability.  
  
  
[-] Credits:  
  
Vulnerability discovered by Egidio Romano.  
  
  
[-] Original Advisory:  
  
http://karmainsecurity.com/KIS-2016-13  
  
  
  
  
`

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

08 Nov 2016 00:00Current
7.4High risk
Vulners AI Score7.4
41