GHSA-xg9w-r469-m455: Zendframework/zendframework ZendFramework Potential Information Disclosure And Vulnerability

HIGH
CVSS 7.4
CWE-330
Published
Advisory Summary

GHSA-xg9w-r469-m455 is a HIGH (CVSS 7.4) zendframework potential information disclosure and vulnerability (CWE-330: Use of Insufficiently Random Values) affecting Zendframework/zendframework libraries in the Packagist ecosystem. The issue involves zendframework potential information disclosure and insufficient entropy vulnerabilities. Remediation is available by upgrading affected packages to version 2.0.8, 2.1.4.

GHSA-xg9w-r469-m455 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-xg9w-r469-m455
Severity HIGH
CVSS v3.1 Base Score 7.4
CWE Classification CWE-330: Use of Insufficiently Random Values
Affected Product Zendframework/zendframework
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.4

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:H/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 High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix GHSA-xg9w-r469-m455

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.8
Upgrade zendframework/zendframework to 2.0.8
zendframework/zendframework fixed: 2.1.4
Upgrade zendframework/zendframework to 2.1.4
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-xg9w-r469-m455, 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.8), 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-330: Use of Insufficiently Random Values, where the product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers. 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

In Zend Framework 2, the `Zend\Math\Rand` component generates random bytes using the OpenSSL or Mcrypt extensions when available but will otherwise use PHP's `mt_rand()` function as a fallback. All outputs from `mt_rand()` are predictable for the same PHP process if an attacker can brute force the seed used by the Marsenne-Twister algorithm in a Seed Recovery Attack. This attack can be successfully applied with minimum effort if the attacker has access to either a random number from `mt_rand()` or a Session ID generated without using additional entropy. This makes `mt_rand()` unsuitable for generating non-trivial random bytes since it has Insufficient Entropy to protect against brute force attacks on the seed. The `Zend\Validate\Csrf` component generates CSRF tokens by SHA1 hashing a salt, random number possibly generated using `mt_rand()` and a form name. Where the salt is known, an attacker can brute force the SHA1 hash with minimum effort to discover the random number when `mt_rand()` is utilised as a fallback to the OpenSSL and Mcrypt extensions. This constitutes an Information Disclosure where the recovered random number may itself be brute forced to recover the seed value and predict the output of other `mt_rand()` calls for the same PHP process. This may potentially lead to vulnerabilities in areas of an application where `mt_rand()` calls exist beyond the scope of Zend Framework.

GHSA-xg9w-r469-m455 Affected Zendframework/zendframework Versions

2 component(s)
Fixed Versions:
2.0.82.1.4
Product / Package Ecosystem Affected Versions Fixed Version
zendframework/zendframework
Packagist
≥ 2.0.0
< 2.0.8
2.0.8
zendframework/zendframework
Packagist
≥ 2.1.0
< 2.1.4
2.1.4

References

Frequently Asked Questions

What is GHSA-xg9w-r469-m455?
GHSA-xg9w-r469-m455 is a security vulnerability in Zendframework/zendframework involving ZendFramework Potential Information Disclosure and Insufficient Entropy vulnerabilities under CWE-330: Use of Insufficiently Random Values.
Which Zendframework/zendframework versions are affected?
Affected versions include releases prior to 2.0.8, 2.1.4 across affected packages: zendframework/zendframework.
What version fixes GHSA-xg9w-r469-m455?
Upgrading to 2.0.8, 2.1.4 (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.8, 2.1.4. Upgrade your dependency to 2.0.8, 2.1.4 or later.
What is the CVSS score of GHSA-xg9w-r469-m455?
GHSA-xg9w-r469-m455 has a CVSS v3.1 base score of 7.4 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with GHSA-xg9w-r469-m455?
GHSA-xg9w-r469-m455 is classified under CWE-330: Use of Insufficiently Random Values (The product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers.).
How can I check Packagist dependencies for GHSA-xg9w-r469-m455?
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-xg9w-r469-m455",
  "modified" : "2024-06-07T20:27:03Z",
  "published" : "2024-06-07T20:27:03Z",
  "aliases" : [ ],
  "summary" : "ZendFramework Potential Information Disclosure and Insufficient Entropy vulnerabilities",
  "details" : "In Zend Framework 2, the `Zend\\Math\\Rand` component generates random bytes using the OpenSSL or Mcrypt extensions when available but will otherwise use PHP's `mt_rand()` function as a fallback. All outputs from `mt_rand()` are predictable for the same PHP process if an attacker can brute force the seed used by the Marsenne-Twister algorithm in a Seed Recovery Attack. This attack can be successfully applied with minimum effort if the attacker has access to either a random number from `mt_rand()` or a Session ID generated without using additional entropy. This makes `mt_rand()` unsuitable for generating non-trivial random bytes since it has Insufficient Entropy to protect against brute force attacks on the seed.\n\nThe `Zend\\Validate\\Csrf` component generates CSRF tokens by SHA1 hashing a salt, random number possibly generated using `mt_rand()` and a form name. Where the salt is known, an attacker can brute force the SHA1 hash with minimum effort to discover the random number when `mt_rand()` is utilised as a fallback to the OpenSSL and Mcrypt extensions. This constitutes an Information Disclosure where the recovered random number may itself be brute forced to recover the seed value and predict the output of other `mt_rand()` calls for the same PHP process. This may potentially lead to vulnerabilities in areas of an application where `mt_rand()` calls exist beyond the scope of Zend Framework.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "zendframework/zendframework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "zendframework/zendframework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0"
      }, {
        "fixed" : "2.1.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/zendframework/zendframework/commit/6975695dfdb201bda0aea02bcc11b4a85ddc89fa"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zendframework/zendframework/commit/97b98e7208f93613ab358432e56b6e2245153807"
  }, {
    "type" : "WEB",
    "url" : "https://framework.zend.com/security/advisory/ZF2013-02"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/zendframework/zendframework/ZF2013-02.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/zendframework/zendframework"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-330" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-07T20:27:03Z",
    "nvd_published_at" : null
  }
}