CVE-2021-37704: Phpfastcache/phpfastcache Exposed Phpinfo() Leadked Vulnerability

MODERATE
Advisory Identifier: GHSA-cvh5-p6r6-g2qc
CVSS 5.4
CWE-668 CWE-200
Published
Advisory Summary

CVE-2021-37704 is a MODERATE (CVSS 5.4) exposed phpinfo() leadked vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) affecting Phpfastcache/phpfastcache libraries in the Packagist ecosystem. The issue involves exposed phpinfo() leadked via documentation files. Remediation is available by upgrading affected packages to version 6.1.5, 7.1.2, 8.0.7.

CVE-2021-37704 at a Glance

CVE Identifier CVE-2021-37704
GHSA Identifier GHSA-cvh5-p6r6-g2qc
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-668: Exposure of Resource to Wrong Sphere
Affected Product Phpfastcache/phpfastcache
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.4

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

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

How to Fix CVE-2021-37704

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

phpfastcache/phpfastcache fixed: 6.1.5
Upgrade phpfastcache/phpfastcache to 6.1.5
phpfastcache/phpfastcache fixed: 7.1.2
Upgrade phpfastcache/phpfastcache to 7.1.2
phpfastcache/phpfastcache fixed: 8.0.7
Upgrade phpfastcache/phpfastcache to 8.0.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 phpfastcache/phpfastcache

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-37704, inspect your project dependencies for Phpfastcache/phpfastcache:

inspect dependencies for phpfastcache/phpfastcache

Analyze the terminal output to locate any version of Phpfastcache/phpfastcache in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.1.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-668: Exposure of Resource to Wrong Sphere, where the product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. In Phpfastcache/phpfastcache, 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

### Impact The `phpinfo()` can be exposed if the `/vendor` is not protected from public access. This is a rare situation today since the vendor directory is often located outside the web directory or protected via server rule (.htaccess, etc). ### Patches Only the v6, v7 and v8 will be patched respectively in 8.0.7, 7.1.2, 6.1.5. Older versions such as v5, v4 are not longer supported and will **NOT** be patched. ### Workarounds Protect the `/vendor` directory from public access. ### References The first issue revealing this vulnerability is located here: https://github.com/flextype/flextype/issues/567 V6 fix: https://github.com/PHPSocialNetwork/phpfastcache/pull/815 V7 fix: https://github.com/PHPSocialNetwork/phpfastcache/pull/814 V8 fix: https://github.com/PHPSocialNetwork/phpfastcache/pull/813 ### For more information If you have any questions or comments about this advisory: * Open an issue in [our issue tracker](https://github.com/PHPSocialNetwork/phpfastcache/issues) * Email us at [security@geolim4.com](mailto:security@geolim4.com)

CVE-2021-37704 Affected Phpfastcache/phpfastcache Versions

3 component(s)
Fixed Versions:
6.1.57.1.28.0.7
Product / Package Ecosystem Affected Versions Fixed Version
phpfastcache/phpfastcache
Packagist
< 6.1.5
6.1.5
phpfastcache/phpfastcache
Packagist
≥ 7.0.0
< 7.1.2
7.1.2
phpfastcache/phpfastcache
Packagist
≥ 8.0.0
< 8.0.7
8.0.7

References

Frequently Asked Questions

What is CVE-2021-37704?
CVE-2021-37704 is a security vulnerability in Phpfastcache/phpfastcache involving Exposed phpinfo() leadked via documentation files under CWE-668: Exposure of Resource to Wrong Sphere.
Which Phpfastcache/phpfastcache versions are affected?
Affected versions include releases prior to 6.1.5, 7.1.2, 8.0.7 across affected packages: phpfastcache/phpfastcache.
What version fixes CVE-2021-37704?
Upgrading to 6.1.5, 7.1.2, 8.0.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is phpfastcache/phpfastcache affected?
Yes, phpfastcache/phpfastcache is affected in releases prior to 6.1.5, 7.1.2, 8.0.7. Upgrade your dependency to 6.1.5, 7.1.2, 8.0.7 or later.
What is the CVSS score of CVE-2021-37704?
CVE-2021-37704 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:L.
What CWE is associated with CVE-2021-37704?
CVE-2021-37704 is classified under CWE-668: Exposure of Resource to Wrong Sphere (The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.).
How can I check Packagist dependencies for CVE-2021-37704?
Run the dependency tree command: 'inspect dependencies for phpfastcache/phpfastcache'. 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-cvh5-p6r6-g2qc",
  "modified" : "2021-08-26T20:11:49Z",
  "published" : "2021-08-30T16:13:40Z",
  "aliases" : [ "CVE-2021-37704" ],
  "summary" : "Exposed phpinfo() leadked via documentation files",
  "details" : "### Impact\nThe `phpinfo()` can be exposed if the `/vendor` is not protected from public access. This is a rare situation today since the vendor directory is often located outside the web directory or protected via server rule (.htaccess, etc).\n\n### Patches\nOnly the v6, v7 and v8 will be patched respectively in 8.0.7, 7.1.2, 6.1.5.\nOlder versions such as v5, v4 are not longer supported and will **NOT** be patched.\n\n### Workarounds\nProtect the `/vendor` directory from public access.\n\n### References\nThe first issue revealing this vulnerability is located here: https://github.com/flextype/flextype/issues/567\nV6 fix: https://github.com/PHPSocialNetwork/phpfastcache/pull/815\nV7 fix: https://github.com/PHPSocialNetwork/phpfastcache/pull/814\nV8 fix: https://github.com/PHPSocialNetwork/phpfastcache/pull/813\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [our issue tracker](https://github.com/PHPSocialNetwork/phpfastcache/issues)\n* Email us at [security@geolim4.com](mailto:security@geolim4.com)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "phpfastcache/phpfastcache"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.1.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "phpfastcache/phpfastcache"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.1.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "phpfastcache/phpfastcache"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.0.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/PHPSocialNetwork/phpfastcache/security/advisories/GHSA-cvh5-p6r6-g2qc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-37704"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/flextype/flextype/issues/567"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PHPSocialNetwork/phpfastcache/pull/813"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PHPSocialNetwork/phpfastcache/pull/814"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PHPSocialNetwork/phpfastcache/pull/815"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PHPSocialNetwork/phpfastcache/commit/41a77d0d8f126dbd6fbedcd9e6a82e86cdaafa51"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PHPSocialNetwork/phpfastcache/blob/master/CHANGELOG.md#807"
  }, {
    "type" : "WEB",
    "url" : "https://packagist.org/packages/phpfastcache/phpfastcache"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-668" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-08-26T20:11:49Z",
    "nvd_published_at" : "2021-08-12T20:15:00Z"
  }
}