Skip to content
File upload Write-up Advanced

Piwik <= 2.14.3 (viewDataTable) Autoloaded File Inclusion Vulnerability

User input passed through the viewDataTable request parameter is not properly sanitised before being used in a call to the class_exists() PHP function. An attacker could use this to trigger autoloading of arbitrary files, leading to file inclusion.

karmainsecurity.com

Published on karmainsecurity.com

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

The author, on karmainsecurity.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the viewDataTable request parameter is passed to class_exists() without validation, allowing PHP's autoloader to include files based on attacker-controlled input.

What the attacker needed

Access to the affected Piwik instance

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The application takes a value from the web request and passes it to a PHP function that checks whether a class exists. That function can automatically load files based on the name it is given, so a crafted name can make the server load a file the attacker chooses. This is called file inclusion and can lead to running attacker-controlled code.

What is File upload?

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.