{"id":"CVE-2024-5585","state":"PUBLISHED","title":"Command injection via array-ish $command parameter of proc_open() (bypass CVE-2024-1874 fix)","description":"In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, the fix for CVE-2024-1874 does not work if the command name includes trailing spaces. Original issue: when using proc_open() command with array syntax, due to insufficient escaping, if the arguments of the executed command are controlled by a malicious user, the user can supply arguments that would execute arbitrary commands in Windows shell.","publishedAt":"2024-06-09T18:36:50.477Z","updatedAt":"2025-02-13T17:54:21.435Z","severity":{"score":7.7,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L","source":"php"},"assigner":"php","products":["PHP Group PHP"],"affected":[{"vendor":"PHP Group","product":"PHP","defaultStatus":"affected","versions":[{"version":"8.1.*","status":"affected","lessThan":"8.1.29","versionType":"semver"},{"version":"8.2.*","status":"affected","lessThan":"8.2.20","versionType":"semver"},{"version":"8.3.*","status":"affected","lessThan":"8.3.8","versionType":"semver"}],"modules":["proc_open"],"platforms":["Windows"],"repo":"https://github.com/php/php-src"}],"references":["https://github.com/php/php-src/security/advisories/GHSA-9fcc-425m-g385","http://www.openwall.com/lists/oss-security/2024/06/07/1","https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/","https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/","https://security.netapp.com/advisory/ntap-20240726-0002/","https://www.vicarius.io/vsociety/posts/command-injection-vulnerability-in-php-on-windows-systems-cve-2024-1874-and-cve-2024-5585"],"weaknesses":["CWE-116","CWE-78"],"ingestedAt":"2026-10-29T20:08:12.933Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/5xxx/CVE-2024-5585.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.1","cveMetadata":{"cveId":"CVE-2024-5585","state":"PUBLISHED","datePublished":"2024-06-09T18:36:50.477Z","dateUpdated":"2025-02-13T17:54:21.435Z","assignerShortName":"php","assignerOrgId":"dd77f84a-d19a-4638-8c3d-a322d820ed2b","dateReserved":"2024-06-01T00:08:21.997Z"},"containers":{"cna":{"title":"Command injection via array-ish $command parameter of proc_open() (bypass CVE-2024-1874 fix)","descriptions":[{"lang":"en","value":"In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, the fix for CVE-2024-1874 does not work if the command name includes trailing spaces. Original issue: when using proc_open() command with array syntax, due to insufficient escaping, if the arguments of the executed command are controlled by a malicious user, the user can supply arguments that would execute arbitrary commands in Windows shell."}],"affected":[{"vendor":"PHP Group","product":"PHP","defaultStatus":"affected","versions":[{"version":"8.1.*","status":"affected","lessThan":"8.1.29","versionType":"semver"},{"version":"8.2.*","status":"affected","lessThan":"8.2.20","versionType":"semver"},{"version":"8.3.*","status":"affected","lessThan":"8.3.8","versionType":"semver"}],"modules":["proc_open"],"platforms":["Windows"],"repo":"https://github.com/php/php-src"}],"references":[{"url":"https://github.com/php/php-src/security/advisories/GHSA-9fcc-425m-g385"},{"url":"http://www.openwall.com/lists/oss-security/2024/06/07/1"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/"},{"url":"https://security.netapp.com/advisory/ntap-20240726-0002/"}],"metrics":[{"cvssV3_1":{"attackComplexity":"HIGH","attackVector":"NETWORK","availabilityImpact":"LOW","baseScore":7.7,"baseSeverity":"HIGH","confidentialityImpact":"HIGH","integrityImpact":"HIGH","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L","version":"3.1"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-116","description":"CWE-116 Improper Encoding or Escaping of Output","lang":"en","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-78","description":"CWE-78 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"php","orgId":"dd77f84a-d19a-4638-8c3d-a322d820ed2b","dateUpdated":"2024-07-28T14:06:03.143Z"},"configurations":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"This problem only present in Windows versions of PHP. <br>"}],"value":"This problem only present in Windows versions of PHP."}],"credits":[{"lang":"en","type":"reporter","value":"tianstcht"}],"datePublic":"2024-06-09T18:30:00.000Z","source":{"advisory":"GHSA-9fcc-425m-g385","discovery":"EXTERNAL"},"workarounds":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"Using proc_open() string syntax avoids the problem. <br>"}],"value":"Using proc_open() string syntax avoids the problem."}],"x_generator":{"engine":"Vulnogram 0.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","affected":[{"vendor":"php","product":"php","defaultStatus":"affected","versions":[{"version":"8.1.0","status":"affected","lessThan":"8.1.29","versionType":"semver"}],"cpes":["cpe:2.3:a:php:php:8.1.0:-:*:*:*:*:*:*"]},{"vendor":"php","product":"php","defaultStatus":"affected","versions":[{"version":"8.2.0","status":"affected","lessThan":"8.2.20","versionType":"semver"}],"cpes":["cpe:2.3:a:php:php:8.2.0:-:*:*:*:*:*:*"]},{"vendor":"php","product":"php","defaultStatus":"affected","versions":[{"version":"8.3.0","status":"affected","lessThan":"8.3.8","versionType":"semver"}],"cpes":["cpe:2.3:a:php:php:8.3.0:*:*:*:*:*:*:*"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2024-07-16T17:52:45.720953Z","id":"CVE-2024-5585","options":[{"Exploitation":"poc"},{"Automatable":"no"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-07-16T18:15:25.949Z"}},{"title":"CVE Program Container","references":[{"url":"https://github.com/php/php-src/security/advisories/GHSA-9fcc-425m-g385","tags":["x_transferred"]},{"url":"http://www.openwall.com/lists/oss-security/2024/06/07/1","tags":["x_transferred"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PKGTQUOA2NTZ3RXN22CSAUJPIRUYRB4B/","tags":["x_transferred"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/W45DBOH56NQDRTOM2DN2LNA2FZIMC3PK/","tags":["x_transferred"]},{"url":"https://security.netapp.com/advisory/ntap-20240726-0002/","tags":["x_transferred"]},{"url":"https://www.vicarius.io/vsociety/posts/command-injection-vulnerability-in-php-on-windows-systems-cve-2024-1874-and-cve-2024-5585"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-19T07:35:25.799Z"}}]}}}