GHSA-3vwr-jj4f-h98x: Ezsystems/ezpublish kernel Remote Code Execution Vulnerability

HIGH
CWE-94
Published
Advisory Summary

GHSA-3vwr-jj4f-h98x is a HIGH remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Ezsystems/ezpublish kernel libraries in the Packagist ecosystem. The issue involves ez publish remote code execution in file uploads. Remediation is available by upgrading affected packages to version 7.5.6.2, 6.13.6.2, 5.4.14.1.

GHSA-3vwr-jj4f-h98x at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-3vwr-jj4f-h98x
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Ezsystems/ezpublish kernel
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix GHSA-3vwr-jj4f-h98x

To remediate this vulnerability, upgrade all affected Ezsystems/ezpublish kernel dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

ezsystems/ezpublish-kernel fixed: 7.5.6.2
Upgrade ezsystems/ezpublish-kernel to 7.5.6.2
ezsystems/ezpublish-kernel fixed: 6.13.6.2
Upgrade ezsystems/ezpublish-kernel to 6.13.6.2
ezsystems/ezpublish-kernel fixed: 5.4.14.1
Upgrade ezsystems/ezpublish-kernel to 5.4.14.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for ezsystems/ezpublish-kernel

How to Check if You Are Affected

To determine whether your application is affected by GHSA-3vwr-jj4f-h98x, inspect your project dependencies for Ezsystems/ezpublish kernel:

inspect dependencies for ezsystems/ezpublish-kernel

Analyze the terminal output to locate any version of Ezsystems/ezpublish kernel in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.5.6.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Ezsystems/ezpublish kernel, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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 blacklist feature for uploaded filenames, such as ".php". The file types on the blacklist cannot be uploaded. The blacklist is configurable. In eZ Platform you will find it as ezsettings.default.io.file_storage.file_type_blacklist in eZ/Bundle/EzPublishCoreBundle/Resources/config/default_settings.yml in vendors/ezsystems/ezpublish-kernel. In eZ Publish Legacy you will find it as FileExtensionBlackList 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.

GHSA-3vwr-jj4f-h98x Affected Ezsystems/ezpublish kernel Versions

3 component(s)
Fixed Versions:
7.5.6.26.13.6.25.4.14.1
Product / Package Ecosystem Affected Versions Fixed Version
ezsystems/ezpublish-kernel
Packagist
≥ 7.5.0
< 7.5.6.2
7.5.6.2
ezsystems/ezpublish-kernel
Packagist
≥ 6.13.0
< 6.13.6.2
6.13.6.2
ezsystems/ezpublish-kernel
Packagist
≥ 5.4.0
< 5.4.14.1
5.4.14.1

References

Frequently Asked Questions

What is GHSA-3vwr-jj4f-h98x?
GHSA-3vwr-jj4f-h98x is a security vulnerability in Ezsystems/ezpublish kernel involving eZ Publish Remote code execution in file uploads under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Ezsystems/ezpublish kernel versions are affected?
Affected versions include releases prior to 7.5.6.2, 6.13.6.2, 5.4.14.1 across affected packages: ezsystems/ezpublish-kernel.
What version fixes GHSA-3vwr-jj4f-h98x?
Upgrading to 7.5.6.2, 6.13.6.2, 5.4.14.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ezsystems/ezpublish-kernel affected?
Yes, ezsystems/ezpublish-kernel is affected in releases prior to 7.5.6.2, 6.13.6.2, 5.4.14.1. Upgrade your dependency to 7.5.6.2, 6.13.6.2, 5.4.14.1 or later.
What CWE is associated with GHSA-3vwr-jj4f-h98x?
GHSA-3vwr-jj4f-h98x is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check Packagist dependencies for GHSA-3vwr-jj4f-h98x?
Run the dependency tree command: 'inspect dependencies for ezsystems/ezpublish-kernel'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3vwr-jj4f-h98x",
  "modified" : "2024-05-15T21:19:07Z",
  "published" : "2024-05-15T21:19:07Z",
  "aliases" : [ ],
  "summary" : "eZ Publish Remote code execution in file uploads",
  "details" : "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:\n\nhttps://github.com/ezsystems/ezplatform/blob/2.5/doc/nginx/vhost.template#L31\n\nThis 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.\n\nThe fix includes a blacklist feature for uploaded filenames, such as \".php\". The file types on the blacklist cannot be uploaded. The blacklist is configurable. In eZ Platform you will find it as ezsettings.default.io.file_storage.file_type_blacklist in eZ/Bundle/EzPublishCoreBundle/Resources/config/default_settings.yml in vendors/ezsystems/ezpublish-kernel. In eZ Publish Legacy you will find it as FileExtensionBlackList 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.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "ezsystems/ezpublish-kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.5.0"
      }, {
        "fixed" : "7.5.6.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "ezsystems/ezpublish-kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.13.0"
      }, {
        "fixed" : "6.13.6.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "ezsystems/ezpublish-kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.4.0"
      }, {
        "fixed" : "5.4.14.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://ezplatform.com/security-advisories/ezsa-2020-001-remote-code-execution-in-file-uploads"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/ezsystems/ezpublish-kernel/2020-03-03-1.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ezsystems/ezpublish-kernel"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20210304031629/https://developers.ibexa.co/security-advisories/ezsa-2020-001-remote-code-execution-in-file-uploads"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-15T21:19:07Z",
    "nvd_published_at" : null
  }
}