Description
The loadContentFromCookie function in core/Cookie.php in Piwik before 0.5 does not validate strings obtained from cookies before calling the unserialize function, which allows remote attackers to execute arbitrary code or upload arbitrary files via vectors related to the __destruct function in the Piwik_Config class; php://filter URIs; the __destruct functions in Zend Framework, as demonstrated by the Zend_Log destructor; the shutdown functions in Zend Framework, as demonstrated by the Zend_Log_Writer_Mail class; the render function in the Piwik_View class; Smarty templates; and the _eval function in Smarty.
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 1 repository
-
Alexeyan/CVE-2009-4137 ★ 4 · Nov 28, 2017
Exploit for piwik CVE-2009-4140 RCE
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
References
- [oss-security] 20091214 Re: Piwik <= 0.4.5 Cookie Unserialize() Vulnerability mailing-list
- http://piwik.org/blog/2009/12/piwik-response-to-shocking-news-in-php-exploitation/
- http://www.suspekt.org/downloads/POC2009-ShockingNewsInPHPExploitation.pdf
- [oss-security] 20091210 Re: Piwik <= 0.4.5 Cookie Unserialize() Vulnerability mailing-list
- [oss-security] 20091209 Piwik <= 0.4.5 Cookie Unserialize() Vulnerability mailing-list
- http://dev.piwik.org/trac/changeset/1637
- http://www.suspekt.org/2009/12/09/advisory-032009-piwik-cookie-unserialize-vulnerability/
- http://www.sektioneins.de/en/advisories/advisory-032009-piwik-cookie-unserialize-vulnerability/