{"answers":{"affected":"10 open source packages ship an affected version, including ezsystems/ezpublish-legacy.","exploited":"There is no known exploitation of GHSA-pqjm-xcp8-wgmm in the wild and no public exploit code.","fix":"Upgrade ezsystems/ezpublish-legacy to a fixed version for your release line: 2017.12.4.3, 2018.6.1.4, 2018.9.1.3 or 5.3.12.6.","what":"GHSA-pqjm-xcp8-wgmm is a code injection vulnerability in ezsystems/ezpublish-legacy, published on 15 May 2024. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-pqjm-xcp8-wgmm and fix it if it is affected.\n\nWhat it is: GHSA-pqjm-xcp8-wgmm is a code injection vulnerability in ezsystems/ezpublish-legacy, published on 15 May 2024. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-pqjm-xcp8-wgmm in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- ezsystems/ezpublish-legacy (Packagist): affected from 2011.0.0; fixed in 2017.12.4.3\n- ezsystems/ezpublish-legacy (Packagist): affected from 2011.0.0; fixed in 2017.12.4.3\n- ezsystems/ezpublish-legacy (Packagist): affected from 2018.6.0; fixed in 2018.6.1.4\n- ezsystems/ezpublish-legacy (Packagist): affected from 2018.6.0; fixed in 2018.6.1.4\n- ezsystems/ezpublish-legacy (Packagist): affected from 2018.9.0; fixed in 2018.9.1.3\n- ezsystems/ezpublish-legacy (Packagist): affected from 2018.9.0; fixed in 2018.9.1.3\n- ezsystems/ezpublish-legacy (Packagist): affected from 5.3.0; fixed in 5.3.12.6\n- ezsystems/ezpublish-legacy (Packagist): affected from 5.3.0; fixed in 5.3.12.6\n- ezsystems/ezpublish-legacy (Packagist): affected from 5.4.0; fixed in 5.4.12.3\n- ezsystems/ezpublish-legacy (Packagist): affected from 5.4.0; fixed in 5.4.12.3\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-pqjm-xcp8-wgmm/ (Markdown: https://insights.sbomify.com/GHSA-pqjm-xcp8-wgmm/index.md)","id":"GHSA-pqjm-xcp8-wgmm","markdown":"https://insights.sbomify.com/GHSA-pqjm-xcp8-wgmm/index.md","name":"GHSA-pqjm-xcp8-wgmm","record":{"aliases":[],"analysis":{"component_type":"web_application","fix_type":"configuration_change","impacts":["code_execution","privilege_escalation"],"network_reachable":"yes","non_default_config":true,"product_category":"eZ Platform CMS","requires_auth":"low_privilege","summary":"Attackers can execute arbitrary code via uploaded PHP/PHAR files if web server configuration allows execution in upload directories or PHAR stream wrapper is enabled.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"The eZ Platform and Legacy are affected by an issue related to how uploaded PHP and PHAR files are handled, and consists of two parts: 1. Web server configuration, and 2. Disabling the PHAR stream wrapper.\n\n**1. WEB SERVER CONFIGURATION**\nThe sample web server configuration in our documentation can in some cases allow the execution of uploaded PHP/PHAR code. This can be abused to allow priviledge escalation and breach of content access controls, among other things. Please ensure that your web server will not execute files in directories were files may be uploaded, such as web/var/ and ezpublish_legacy/var/\n\nAs an example, here is how you can make Apache return HTTP 403 Forbidden for a number of executable file types in your eZ Platform var directory. Please adapt it to your needs. It is then possible to enable logging of HTTP 403 in a separate log file if you wish, you could do this to see if someone is trying to abuse the server.\n```\nRewriteEngine On\n\n# disable .php(3) and other extensions in the var directory\nRewriteRule ^var/.*(?i)\\.(php3?|phar|phtml|sh|exe|pl|bin)$ - [F]\n```\nHere is the same configuration, but for the Nginx web server:\n```\nlocation ~ ^/var/.*(?i)\\.(php3?|phar|phtml|sh|exe|pl|bin)$ {\n  return 403;\n}\n```\n\n**2. DISABLE PHAR STREAM WRAPPER**\nPHAR archives may be crafted such that its stream wrapper will execute them without being specifically asked to. With such files, any PHP file operation may cause deserialisation and execution. This may happen even if the file name suffix isn't \".phar\". Any site that allows file uploads is at risk. Normally eZ Platform has no need for PHAR support. It's only used by Composer, and that is executed separately from eZ Platform. So one way to avoid this vulnerability is to disable the PHAR stream wrapper within eZ Platform. (If you know you need PHAR support, please consider other means to deal with this vulnerability. For example, enabling the wrapper only in those scripts/bundles that have to deal with such files.)\n\nDisabling the stream wrapper should be done in:\n\neZ Platform (web/app.php)\nCLI scripts (bin/console)\nLegacy (index.php and CLI scripts)\n\nTo install, use Composer to update to one of the \"Resolving versions\" mentioned above, or apply these patches manually:\nhttps://github.com/ezsystems/ezplatform/commit/9a0c52dc4535e4b3ce379f80222dc53f705a2cfd\nhttps://github.com/ezsystems/ezpublish-legacy/commit/d21957bf202b091ab39dfb5be300f6c30be3933e","ecosystems":["Packagist"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Ez Platform and Legacy are prone to an insecure interpretation of PHP/PHAR uploads","id":"GHSA-pqjm-xcp8-wgmm","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Packagist","product":null,"products":[],"type":"code_injection","year":"2024"},"n_packages":10,"n_references":null,"packages":[{"ecosystem":"Packagist","fixed":["2017.12.4.3"],"introduced":["2011.0.0"],"last_affected":[],"package":"ezsystems/ezpublish-legacy","purl":null,"source":"GHSA-pqjm-xcp8-wgmm"},{"ecosystem":"Packagist","fixed":["2017.12.4.3"],"introduced":["2011.0.0"],"last_affected":[],"package":"ezsystems/ezpublish-legacy","purl":"pkg:composer/ezsystems/ezpublish-legacy","source":"GHSA-pqjm-xcp8-wgmm"},{"ecosystem":"Packagist","fixed":["2018.6.1.4"],"introduced":["2018.6.0"],"last_affected":[],"package":"ezsystems/ezpublish-legacy","purl":null,"source":"GHSA-pqjm-xcp8-wgmm"},{"ecosystem":"Packagist","fixed":["2018.6.1.4"],"introduced":["2018.6.0"],"last_affected":[],"package":"ezsystems/ezpublish-legacy","purl":"pkg:composer/ezsystems/ezpublish-legacy","source":"GHSA-pqjm-xcp8-wgmm"},{"ecosystem":"Packagist","fixed":["2018.9.1.3"],"introduced":["2018.9.0"],"last_affected":[],"package":"ezsystems/ezpublish-legacy","purl":null,"source":"GHSA-pqjm-xcp8-wgmm"},{"ecosystem":"Packagist","fixed":["2018.9.1.3"],"introduced":["2018.9.0"],"last_affected":[],"package":"ezsystems/ezpublish-legacy","purl":"pkg:composer/ezsystems/ezpublish-legacy","source":"GHSA-pqjm-xcp8-wgmm"},{"ecosystem":"Packagist","fixed":["5.3.12.6"],"introduced":["5.3.0"],"last_affected":[],"package":"ezsystems/ezpublish-legacy","purl":null,"source":"GHSA-pqjm-xcp8-wgmm"},{"ecosystem":"Packagist","fixed":["5.3.12.6"],"introduced":["5.3.0"],"last_affected":[],"package":"ezsystems/ezpublish-legacy","purl":"pkg:composer/ezsystems/ezpublish-legacy","source":"GHSA-pqjm-xcp8-wgmm"},{"ecosystem":"Packagist","fixed":["5.4.12.3"],"introduced":["5.4.0"],"last_affected":[],"package":"ezsystems/ezpublish-legacy","purl":null,"source":"GHSA-pqjm-xcp8-wgmm"},{"ecosystem":"Packagist","fixed":["5.4.12.3"],"introduced":["5.4.0"],"last_affected":[],"package":"ezsystems/ezpublish-legacy","purl":"pkg:composer/ezsystems/ezpublish-legacy","source":"GHSA-pqjm-xcp8-wgmm"}],"products":null,"published":"2024-05-15","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can execute arbitrary code via uploaded PHP/PHAR files if web server configuration allows execution in upload directories or PHAR stream wrapper is enabled.","url":"https://insights.sbomify.com/GHSA-pqjm-xcp8-wgmm/"}