CVE-2024-50340: Symfony/runtime Symfony Allows Changing The Environment Vulnerability

MODERATE
Advisory Identifier: GHSA-x8vp-gf4q-mw5j
CVSS 7.3
CWE-20 CWE-74
Published
Advisory Summary

CVE-2024-50340 is a MODERATE (CVSS 7.3) symfony allows changing the environment vulnerability (CWE-20: Improper Input Validation) affecting Symfony/runtime libraries in the Packagist ecosystem. The issue involves symfony allows changing the environment through a query. Remediation is available by upgrading affected packages to version 5.4.46, 6.4.14, 7.1.7.

CVE-2024-50340 at a Glance

CVE Identifier CVE-2024-50340
GHSA Identifier GHSA-x8vp-gf4q-mw5j
Severity MODERATE
CVSS v3.1 Base Score 7.3
CWE Classification CWE-20: Improper Input Validation
Affected Product Symfony/runtime
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.3

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

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

How to Fix CVE-2024-50340

To remediate this vulnerability, upgrade all affected Symfony/runtime 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/runtime fixed: 5.4.46
Upgrade symfony/runtime to 5.4.46
symfony/runtime fixed: 6.4.14
Upgrade symfony/runtime to 6.4.14
symfony/runtime fixed: 7.1.7
Upgrade symfony/runtime 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/runtime

How to Check if You Are Affected

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

inspect dependencies for symfony/runtime

Analyze the terminal output to locate any version of Symfony/runtime 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Symfony/runtime, 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 When the `register_argc_argv` php directive is set to `on` , and users call any URL with a special crafted query string, they are able to change the environment or debug mode used by the kernel when handling the request. ### Resolution The `SymfonyRuntime` now ignores the `argv` values for non-cli SAPIs PHP runtimes The patch for this issue is available [here](https://github.com/symfony/symfony/commit/a77b308c3f179ed7c8a8bc295f82b2d6ee3493fa) for branch 5.4. ### Credits We would like to thank Vladimir Dusheyko for reporting the issue and Wouter de Jong for providing the fix.

CVE-2024-50340 Affected Symfony/runtime Versions

6 component(s)
Fixed Versions:
5.4.466.4.147.1.7
Product / Package Ecosystem Affected Versions Fixed Version
symfony/runtime
Packagist
≥ 5.3.0
< 5.4.46
5.4.46
symfony/runtime
Packagist
≥ 6.0.0
< 6.4.14
6.4.14
symfony/runtime
Packagist
≥ 7.0.0
< 7.1.7
7.1.7
symfony/symfony
Packagist
≥ 5.3.0
< 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-50340?
CVE-2024-50340 is a security vulnerability in Symfony/runtime involving Symfony allows changing the environment through a query under CWE-20: Improper Input Validation.
Which Symfony/runtime versions are affected?
Affected versions include releases prior to 5.4.46, 6.4.14, 7.1.7 across affected packages: symfony/runtime, symfony/symfony.
What version fixes CVE-2024-50340?
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/runtime affected?
Yes, symfony/runtime 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-50340?
CVE-2024-50340 has a CVSS v3.1 base score of 7.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2024-50340?
CVE-2024-50340 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Packagist dependencies for CVE-2024-50340?
Run the dependency tree command: 'inspect dependencies for symfony/runtime'. 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-x8vp-gf4q-mw5j",
  "modified" : "2024-11-06T23:39:51Z",
  "published" : "2024-11-06T15:11:07Z",
  "aliases" : [ "CVE-2024-50340" ],
  "summary" : "Symfony allows changing the environment through a query",
  "details" : "### Description\n\nWhen the `register_argc_argv` php directive is set to `on` , and users call any URL with a special crafted query string, they are able to change the environment or debug mode used by the kernel when handling the request.\n\n### Resolution\n\nThe `SymfonyRuntime` now ignores the `argv` values for non-cli SAPIs PHP runtimes\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/a77b308c3f179ed7c8a8bc295f82b2d6ee3493fa) for branch 5.4.\n\n### Credits\n\nWe would like to thank Vladimir Dusheyko for reporting the issue and Wouter de Jong for providing the fix.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/runtime"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.3.0"
      }, {
        "fixed" : "5.4.46"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/runtime"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.4.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/runtime"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.1.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.3.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-x8vp-gf4q-mw5j"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-50340"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/a77b308c3f179ed7c8a8bc295f82b2d6ee3493fa"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/runtime/CVE-2024-50340.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2024-50340.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2024-50340"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-74" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-06T15:11:07Z",
    "nvd_published_at" : "2024-11-06T21:15:05Z"
  }
}