PatchClock

PHP security digest · 7 Oct 2026

Kunstmaan CMS: MediaBundle extension blacklist bypass allows authenticated administrators to upload executable PHP files leading to remote code execution

High CVE-2026-104890

Packages
kunstmaan/media-bundle, kunstmaan/bundles-cms
Fixed in
7.3.2
Published
Wed 7 Oct 2026, 19:05 LisbonUpdated Mon 26 Oct 2026, 03:26 Lisbon
Installs on Packagist
138K

In plain words

An authenticated backend user with access to the admin media section can bypass the upload extension blacklist and upload a file that the web server executes as PHP. If the server executes scripts in the web-accessible media upload directory, this allows arbitrary code execution as the web server user. The uploaded file can then be reached over HTTP without authentication.

Affected versions

PackageAffectedFixed in
kunstmaan/media-bundle< 7.3.27.3.2
kunstmaan/bundles-cms< 7.3.27.3.2

Am I affected?

Check composer.lock for kunstmaan/media-bundle or kunstmaan/bundles-cms below 7.3.2. If present, check who has access to the admin media section and whether the web server executes scripts in the media upload directory. Version 7.3.2 fixes the flaw but does not rename existing files, so audit that directory for files with executable extensions.

What to do

Check which version you have, then update to a fixed release for your branch (7.3.2):

composer show kunstmaan/media-bundle | grep versions
composer update kunstmaan/media-bundle

If your version constraint in composer.json keeps you below a fixed release, raise it first. Whether your configuration is affected, and the exact version ranges, are in the advisory itself.

If you cannot update yet

If you cannot upgrade, configure the web server to refuse to execute scripts in the media upload directory, for example using a location block in nginx or php_flag engine off in Apache.

The advisory's description

Summary

The MediaBundle blocks dangerous upload extensions with a blacklist that was matched case-sensitively, while the stored filename was lowercased afterwards. A file uploaded as webshell.pHp therefore bypassed the blacklist and was written to the web-accessible upload directory as webshell.php, where the web server executed it. Any authenticated backend user with access to the media section could obtain remote code execution.

Details

FileHandler::getFilePath() rewrote blacklisted extensions to .txt using a case-sensitive regex, and only then lowercased the extension when building the stored name — so the check ran against the attacker-controlled casing and the normalisation happened after it.

Two further weaknesses contributed:

  • The default blacklist contained only php and htaccess, leaving other server-executable extensions (phtml, php5, phar, shtml, cgi, …) unblocked regardless of casing.
  • Configured blacklist values were interpolated into the regex unescaped.

Impact

An authenticated user with access to the admin media section can upload a file that the web server executes as PHP. The uploaded file is reachable over HTTP without authentication, giving arbitrary code execution as the web server user.

Patches

Fixed in kunstmaan/media-bundle 7.3.2. The extension is now normalised before it is checked and compared with in_array(); the default blacklist is expanded to the full set of server-executable extensions; and a new opt-in allowed_extensions option allows projects to enforce a strict allow-list.

Note that the patch does not rename files already stored on disk. Sites should audit their media upload directory for existing files with an executable extension.

Workarounds

If you cannot upgrade, configure the web server to refuse to execute scripts in the media upload directory (for example a location block in nginx or php_flag engine off in Apache).

Weakness: CWE-434 Unrestricted Upload of File with Dangerous Type. Reported by N0fl0w, acrobat.

The advisory

From OSV.dev, which gathers the GitHub Advisory Database, FriendsOfPHP and Drupal security advisories; the summary is theirs. The description, affected versions, weakness and credits are from the GitHub Advisory Database (CC BY 4.0). "In plain words", "Am I affected?" and "If you cannot update yet" are based on that advisory, and checked to name no version it does not.