GHSA-mg7h-9qfx-4r83: Zendframework/zendframework ZendFramework Potential Proxy Injection Vulnerabilities Vulnerability

MODERATE
CVSS 5.9
CWE-74
Published
Advisory Summary

GHSA-mg7h-9qfx-4r83 is a MODERATE (CVSS 5.9) zendframework potential proxy injection vulnerabilities vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Zendframework/zendframework libraries in the Packagist ecosystem. The issue involves zendframework potential proxy injection vulnerabilities. Remediation is available by upgrading affected packages to version 2.0.5.

GHSA-mg7h-9qfx-4r83 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-mg7h-9qfx-4r83
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Zendframework/zendframework
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.9

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

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

How to Fix GHSA-mg7h-9qfx-4r83

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

zendframework/zendframework fixed: 2.0.5
Upgrade zendframework/zendframework to 2.0.5
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 zendframework/zendframework

How to Check if You Are Affected

To determine whether your application is affected by GHSA-mg7h-9qfx-4r83, inspect your project dependencies for Zendframework/zendframework:

inspect dependencies for zendframework/zendframework

Analyze the terminal output to locate any version of Zendframework/zendframework in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.5), 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-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Zendframework/zendframework, 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

`Zend\Session\Validator\RemoteAddr` and `Zend\View\Helper\ServerUrl` were found to be improperly parsing HTTP headers for proxy information, which could potentially allow an attacker to spoof a proxied IP or host name. In `Zend\Session\Validator\RemoteAddr`, if the client is behind a proxy server, the detection of the proxy URL was incorrect, and could lead to invalid results on subsequent lookups. In `Zend\View\Helper\ServerUrl`, if the server lives behind a proxy, the helper would always generate a URL based on the proxy host, regardless of whether or not this was desired; additionally, it did not take into account the proxy port or protocol, if provided.

GHSA-mg7h-9qfx-4r83 Affected Zendframework/zendframework Versions

1 component(s)
Fixed Versions:
2.0.5
Product / Package Ecosystem Affected Versions Fixed Version
zendframework/zendframework
Packagist
≥ 2.0.0
< 2.0.5
2.0.5

References

Frequently Asked Questions

What is GHSA-mg7h-9qfx-4r83?
GHSA-mg7h-9qfx-4r83 is a security vulnerability in Zendframework/zendframework involving ZendFramework Potential Proxy Injection Vulnerabilities under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Zendframework/zendframework versions are affected?
Affected versions include releases prior to 2.0.5 across affected packages: zendframework/zendframework.
What version fixes GHSA-mg7h-9qfx-4r83?
Upgrading to 2.0.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is zendframework/zendframework affected?
Yes, zendframework/zendframework is affected in releases prior to 2.0.5. Upgrade your dependency to 2.0.5 or later.
What is the CVSS score of GHSA-mg7h-9qfx-4r83?
GHSA-mg7h-9qfx-4r83 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with GHSA-mg7h-9qfx-4r83?
GHSA-mg7h-9qfx-4r83 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.).
How can I check Packagist dependencies for GHSA-mg7h-9qfx-4r83?
Run the dependency tree command: 'inspect dependencies for zendframework/zendframework'. 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-mg7h-9qfx-4r83",
  "modified" : "2024-06-07T20:46:14Z",
  "published" : "2024-06-07T20:46:14Z",
  "aliases" : [ ],
  "summary" : "ZendFramework Potential Proxy Injection Vulnerabilities",
  "details" : "`Zend\\Session\\Validator\\RemoteAddr` and `Zend\\View\\Helper\\ServerUrl` were found to be improperly parsing HTTP headers for proxy information, which could potentially allow an attacker to spoof a proxied IP or host name.\n\nIn `Zend\\Session\\Validator\\RemoteAddr`, if the client is behind a proxy server, the detection of the proxy URL was incorrect, and could lead to invalid results on subsequent lookups.\n\nIn `Zend\\View\\Helper\\ServerUrl`, if the server lives behind a proxy, the helper would always generate a URL based on the proxy host, regardless of whether or not this was desired; additionally, it did not take into account the proxy port or protocol, if provided.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "zendframework/zendframework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/zendframework/zendframework/commit/1040acaf70d297ec7214934d8ddc3e811d249b5c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zendframework/zendframework/commit/ad8fdc3378710b7cfbe2a271dbb0e3256cffb599"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zendframework/zendframework/commit/ada1fab92f6d5c7ad96c5a63f3196d925e3f5887"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zendframework/zendframework/commit/b914ecdd4d17ab5b61f15ccdc02a6e9b255b15d8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zendframework/zendframework/commit/c3819abbf2c9571069c893d27ae6170bda413925"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zendframework/zendframework/commit/cfaf5ea095c93f3e70343358a3a88c3924d7ed7d"
  }, {
    "type" : "WEB",
    "url" : "https://framework.zend.com/security/advisory/ZF2012-04"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/zendframework/zendframework/ZF2012-04.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/zendframework/zendframework"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-07T20:46:14Z",
    "nvd_published_at" : null
  }
}