CVE-2024-51736: Symfony/process Symfony Vulnerable To Command Execution Vulnerability

HIGH
Advisory Identifier: GHSA-qq5c-677p-737q
CVSS 8.4
CWE-77
Published
Advisory Summary

CVE-2024-51736 is a HIGH (CVSS 8.4) symfony vulnerable to command execution vulnerability (CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')) affecting Symfony/process libraries in the Packagist ecosystem. The issue involves symfony vulnerable to command execution hijack on windows with process class. Remediation is available by upgrading affected packages to version 5.4.46, 6.4.14, 7.1.7.

CVE-2024-51736 at a Glance

CVE Identifier CVE-2024-51736
GHSA Identifier GHSA-qq5c-677p-737q
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
Affected Product Symfony/process
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-51736

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

symfony/process fixed: 5.4.46
Upgrade symfony/process to 5.4.46
symfony/process fixed: 6.4.14
Upgrade symfony/process to 6.4.14
symfony/process fixed: 7.1.7
Upgrade symfony/process to 7.1.7
symfony/symfony fixed: 5.4.46
Upgrade symfony/symfony to 5.4.46
symfony/symfony fixed: 6.4.14
Upgrade symfony/symfony to 6.4.14
symfony/symfony fixed: 7.1.7
Upgrade symfony/symfony to 7.1.7
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 symfony/process

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-51736, inspect your project dependencies for Symfony/process:

inspect dependencies for symfony/process

Analyze the terminal output to locate any version of Symfony/process in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.4.46), 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-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where the product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. In Symfony/process, 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

### Description On Windows, when an executable file named `cmd.exe` is located in the current working directory it will be called by the `Process` class when preparing command arguments, leading to possible hijacking. ### Resolution The `Process` class now uses the absolute path to `cmd.exe`. The patch for this issue is available [here](https://github.com/symfony/symfony/commit/18ecd03eda3917fdf901a48e72518f911c64a1c9) for branch 5.4. ### Credits We would like to thank Jordi Boggiano for reporting the issue and Nicolas Grekas for providing the fix.

CVE-2024-51736 Affected Symfony/process Versions

6 component(s)
Fixed Versions:
5.4.466.4.147.1.7
Product / Package Ecosystem Affected Versions Fixed Version
symfony/process
Packagist
< 5.4.46
5.4.46
symfony/process
Packagist
≥ 6.0.0
< 6.4.14
6.4.14
symfony/process
Packagist
≥ 7.0.0
< 7.1.7
7.1.7
symfony/symfony
Packagist
< 5.4.46
5.4.46
symfony/symfony
Packagist
≥ 6.0.0
< 6.4.14
6.4.14
symfony/symfony
Packagist
≥ 7.0.0
< 7.1.7
7.1.7

References

Frequently Asked Questions

What is CVE-2024-51736?
CVE-2024-51736 is a security vulnerability in Symfony/process involving Symfony vulnerable to command execution hijack on Windows with Process class under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').
Which Symfony/process versions are affected?
Affected versions include releases prior to 5.4.46, 6.4.14, 7.1.7 across affected packages: symfony/process, symfony/symfony.
What version fixes CVE-2024-51736?
Upgrading to 5.4.46, 6.4.14, 7.1.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/process affected?
Yes, symfony/process is affected in releases prior to 5.4.46, 6.4.14, 7.1.7. Upgrade your dependency to 5.4.46, 6.4.14, 7.1.7 or later.
Is symfony/symfony affected?
Yes, symfony/symfony is affected in releases prior to 5.4.46, 6.4.14, 7.1.7. Upgrade your dependency to 5.4.46, 6.4.14, 7.1.7 or later.
What is the CVSS score of CVE-2024-51736?
CVE-2024-51736 has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2024-51736?
CVE-2024-51736 is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') (The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.).
How can I check Packagist dependencies for CVE-2024-51736?
Run the dependency tree command: 'inspect dependencies for symfony/process'. 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-qq5c-677p-737q",
  "modified" : "2025-03-07T13:28:46Z",
  "published" : "2024-11-06T15:22:55Z",
  "aliases" : [ "CVE-2024-51736" ],
  "summary" : "Symfony vulnerable to command execution hijack on Windows with Process class",
  "details" : "### Description\n\nOn Windows, when an executable file named `cmd.exe` is located in the current working directory it will be called by the `Process` class when preparing command arguments, leading to possible hijacking.\n\n### Resolution\n\nThe `Process` class now uses the absolute path to `cmd.exe`.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/18ecd03eda3917fdf901a48e72518f911c64a1c9) for branch 5.4.\n\n### Credits\n\nWe would like to thank Jordi Boggiano for reporting the issue and Nicolas Grekas for providing the fix.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/process"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.4.46"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/process"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.4.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/process"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.1.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.4.46"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.4.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.1.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/security/advisories/GHSA-qq5c-677p-737q"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-51736"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/18ecd03eda3917fdf901a48e72518f911c64a1c9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/process/CVE-2024-51736.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2024-51736.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2024-51736"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-77" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-06T15:22:55Z",
    "nvd_published_at" : "2024-11-06T21:15:06Z"
  }
}