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

Published Apr 29, 2024
·
Updated

Command injection via array-ish $command parameter of procopen()

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.28, 8.2. before 8.2.18, 8.3. before 8.3.5, 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.

NVD

Affected Software

9 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.28
PHP PHP>=8.2.0<8.2.18
PHP PHP>=8.3.0<8.3.5
Fedoraproject Fedora=39
Fedoraproject Fedora=40
Microsoft azl3 php 8.3.6-1<8.3.8-1
8.3.8-1
Microsoft azl3 php 8.3.8-1<8.3.8-1
8.3.8-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.

    Fixed in 8.3.8-1
  4. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.1.28
  5. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.2.18
  6. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.3.5
  7. Upgrade

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

    Patch GHSA-9fcc-425m-g385

Event History

Apr 29, 2024
CVE Published
via MITRE·03:57 AM
Data Sourced
via MITRE·03:57 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:15 AM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
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 is the severity of CVE-2024-1874?

CVE-2024-1874 has a critical severity level due to its potential for command injection vulnerabilities.

2

How do I fix CVE-2024-1874?

To fix CVE-2024-1874, upgrade PHP to version 8.1.29 or later, or to version 8.2.20 or later.

3

What versions of PHP are affected by CVE-2024-1874?

CVE-2024-1874 affects PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, and 8.3.* before 8.3.5.

4

Can CVE-2024-1874 be exploited remotely?

Yes, CVE-2024-1874 can be exploited remotely if an attacker can send crafted commands to the affected PHP code.

5

What is proc_open() in the context of CVE-2024-1874?

In the context of CVE-2024-1874, proc_open() is a PHP function that creates a process based on command arguments which may lack sufficient escaping, leading to vulnerabilities.

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