Piwik <= 2.14.3 (viewDataTable) Autoloaded File Inclusion Vulnerability

• Software Link:


• Affected Versions:

Version 2.14.3 and prior versions.

• Vulnerability Description:

The vulnerable code is located in the /core/ViewDataTable/Factory.php script:

            $type = Common::getRequestVar('viewDataTable', $defaultType, 'string');

            // Common::getRequestVar removes backslashes from the defaultValue in case magic quotes are enabled.
            // therefore do not pass this as a default value to getRequestVar()
            if ('' === $type) {
                $type = $defaultType ?: HtmlTable::ID;
        } else {
            $type = $defaultViewType;

        $params['viewDataTable'] = $type;

        $visualizations = Manager::getAvailableViewDataTables();

        if (array_key_exists($type, $visualizations)) {
            return self::createViewDataTableInstance($visualizations[$type], $controllerAction, $apiAction, $params);

        if (class_exists($type)) {

User input passed through the “viewDataTable” request parameter is not properly sanitized before being used in a call to the “class_exists()” function at line 149. This could be exploited to include arbitrary .php files located outside the Piwik root directory or from the Piwik codebase itself (possibly leading to unauthorized access to certain functionalities) leveraging the Composer autoloading function. Successful exploitation of this vulnerability requires the application running on PHP before 5.4.24 or 5.5.8.

• Solution:

Update to version 2.15.0 or later.

• Disclosure Timeline:

[25/08/2015] – Vendor notified
[09/09/2015] – Issue fixed on the GitHub repository: http://git.io/vlyZv
[06/10/2015] – CVE number requested
[14/10/2015] – CVE number assigned
[22/10/2015] – Version 2.15.0 released: https://piwik.org/changelog/piwik-2-15-0
[04/11/2015] – Public disclosure

• CVE Reference:

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

• Credits:

Vulnerability discovered by Egidio Romano.