Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. ezsystems/ezpublish-legacy
  4. ›
  5. GHSA-9895-26wr-4fgv

GHSA-9895-26wr-4fgv: EZsystems Remote code execution in file uploads

May 15, 2024

This Security Advisory is about a vulnerability in the way eZ Platform and eZ Publish Legacy handles file uploads, which can in the worst case lead to remote code execution (RCE), a very serious threat. An attacker would need access to uploading files to be able to exploit the vulnerability, so if you have strict controls on this and trust all who have this permission, you’re not affected. On the basis of the tests we have made, we also believe the vulnerability cannot be exploited as long as our recommended vhost configuration is used. Here is the v2.5 recommendation for Nginx, as an example:

https://github.com/ezsystems/ezplatform/blob/2.5/doc/nginx/vhost.template#L31

This vhost template specifies that only the file app.php in the web root is executed, while vulnerable configurations allow execution of any php file. Apache is affected in the same way as Nginx, and is also protected by using the recommended configuration. The build-in webserver in PHP stays vulnerable, as it doesn’t use this type of configuration (this webserver should only be used for development, never for production). We cannot be 100% certain our configuration is not vulnerable. We also do not know if all our users use the recommended configuration, so we send out this fix to be on the safe side.

The fix includes a blocklist feature for uploaded filenames, such as “.php”. The file types on the blocklist cannot be uploaded. The blocklist is configurable. In eZ Platform you will find it as ezsettings.default.io.file_storage.file_type_blocklist in eZ/Bundle/EzPublishCoreBundle/Resources/config/default_settings.yml in vendors/ezsystems/ezpublish-kernel. In eZ Publish Legacy you will find it as FileExtensionblocklist in settings/file.ini. By default it blocks these file types: php, php3, phar, phpt, pht, phtml, pgif. The fix also inclues a new block against path traversal attacks, though this kind of attack was not reproducible in our tests.

References

  • ezplatform.com/security-advisories/ezsa-2020-001-remote-code-execution-in-file-uploads
  • github.com/FriendsOfPHP/security-advisories/blob/master/ezsystems/ezpublish-legacy/2020-03-03-1.yaml
  • github.com/advisories/GHSA-9895-26wr-4fgv
  • github.com/ezsystems/ezpublish-legacy

Code Behaviors & Features

Detect and mitigate GHSA-9895-26wr-4fgv with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 5.4.0 before 5.4.14.1, all versions starting from 2017.12.0 before 2017.12.7.2, all versions starting from 2019.3.0 before 2019.3.4.2

Fixed versions

  • 2019.3.4.2
  • 2017.12.7.2
  • 5.4.14.1

Solution

Upgrade to versions 2017.12.7.2, 2019.3.4.2, 5.4.14.1 or above.

Weakness

  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

packagist/ezsystems/ezpublish-legacy/GHSA-9895-26wr-4fgv.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:33 +0000.