CVE-2024-5585: Command injection via array-ish $command parameter of proc_open() (bypass CVE-2024-1874 fix)

Published Jun 6, 2024
·
Updated

Command injection via array-ish $command parameter of procopen() (bypass CVE-2024-1874 fix)

Other sources

Fixed bug GHSA-9fcc-425m-g385 (Bypass of CVE-2024-1874). (CVE-2024-5585)

PHP

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 procopen() 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.

MITRE

Affected Software

11 affected componentsFixes available
PHP PHP<8.1.29
8.1.29
PHP PHP<8.2.20
8.2.20
PHP PHP>=8.1.0<8.1.29
PHP PHP>=8.2.0<8.2.20
PHP PHP>=8.3.0<8.3.8
Fedoraproject Fedora=40
Microsoft cbl2 php 8.1.28-1
Microsoft azl3 php 8.3.8-1
Microsoft azl3 php 8.3.6-1
Microsoft cbl2 php 8.1.28-1
Microsoft cbl2 php 8.1.29-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.1.29
  2. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.2.20
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch GHSA-9fcc-425m-g385
  4. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 8.1.29
  5. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 8.2.20
  6. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 8.3.8

Event History

Jun 6, 2024
CVE Published
via PHP·12:00 AM
Jun 9, 2024
CVE Published
via MITRE·06:36 PM
Data Sourced
via MITRE·06:36 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·07:15 PM
DescriptionSeverityWeaknessAffected Software
Jun 30, 2024
Data Sourced
via Microsoft·02:00 PM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·02:00 PM
Affected Software
Updated
via Microsoft·02:00 PM
SeverityAffected Software
Updated
via Microsoft·02:00 PM
Affected Software
Updated
via Microsoft·02:00 PM
DescriptionSeverity
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What are the affected versions for CVE-2024-5585?

CVE-2024-5585 affects PHP versions 8.1.0 to 8.1.28, 8.2.0 to 8.2.19, and 8.3.0 to 8.3.7.

2

What is the severity of CVE-2024-5585?

CVE-2024-5585 has not been officially assigned a severity rating, but it represents a critical command execution vulnerability.

3

How do I fix CVE-2024-5585?

To fix CVE-2024-5585, upgrade PHP to versions 8.1.29, 8.2.20, or 8.3.8 or later.

4

What is the nature of the vulnerability in CVE-2024-5585?

CVE-2024-5585 allows for a bypass of previous fixes if command names include trailing spaces when using proc_open().

5

Is there a workaround for CVE-2024-5585?

There is no specific workaround for CVE-2024-5585; upgrading to a fixed PHP version is the recommended solution.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203