Skip to content
File upload Write-up Intermediate

Dotclear <= 2.6.2 (Media Manager) Unrestricted File Upload Vulnerability

The media manager's file exclusion check only matched filenames ending in .php, so an attacker could upload a file with a different or multiple extension and have it executed as PHP code. This allowed arbitrary PHP code execution on the server.

karmainsecurity.com

Published on karmainsecurity.com

The vulnerability exists because of the filemanager::isFileExclude() method not properly verifying the extension of uploaded files. This method just checks whether the uploaded file name matches the “excludepattern” regular expression, which by default is set to /\.php$/i.

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

The exclusion check relied on a single regular expression that only matched names ending in .php, rather than validating the actual file type or blocking all executable extensions.

Impact

An attacker could execute arbitrary PHP code on the server, which could lead to full compromise of the application and its data.

What the attacker needed

Access to the media manager upload feature

The fix

The file exclusion check should validate the real file type and block all executable extensions, not just names ending in .php.

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.

A file upload feature is meant to let people add images or documents, but the site tried to block dangerous PHP files by checking only whether the name ended in '.php'. An attacker could give the file a different name, such as one with two extensions, so the check missed it and the server ran the file as code. That means the attacker could run their own instructions on the server.

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.