CVE-2012-4399: Cakephp/cakephp CakePHPallows Remote Attackers To Read Vulnerability

HIGH
Advisory Identifier: GHSA-5964-pq8r-4q62
CVSS 7.5
CWE-611
Published
Advisory Summary

CVE-2012-4399 is a HIGH (CVSS 7.5) cakephpallows remote attackers to read vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Cakephp/cakephp libraries in the Packagist ecosystem. The issue involves cakephpallows remote attackers to read arbitrary files via xml data containing external entity references. Remediation is available by upgrading affected packages to version 2.1.5, 2.2.1.

CVE-2012-4399 at a Glance

CVE Identifier CVE-2012-4399
GHSA Identifier GHSA-5964-pq8r-4q62
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Cakephp/cakephp
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:H/I:N/A:N).

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

How to Fix CVE-2012-4399

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

cakephp/cakephp fixed: 2.1.5
Upgrade cakephp/cakephp to 2.1.5
cakephp/cakephp fixed: 2.2.1
Upgrade cakephp/cakephp to 2.2.1
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 cakephp/cakephp

How to Check if You Are Affected

To determine whether your application is affected by CVE-2012-4399, inspect your project dependencies for Cakephp/cakephp:

inspect dependencies for cakephp/cakephp

Analyze the terminal output to locate any version of Cakephp/cakephp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.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-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. In Cakephp/cakephp, 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

The Xml class in CakePHP 2.1.x before 2.1.5 and 2.2.x before 2.2.1 allows remote attackers to read arbitrary files via XML data containing external entity references, aka an XML external entity (XXE) injection attack.

CVE-2012-4399 Affected Cakephp/cakephp Versions

2 component(s)
Fixed Versions:
2.1.52.2.1
Product / Package Ecosystem Affected Versions Fixed Version
cakephp/cakephp
Packagist
≥ 2.1.0-alpha
< 2.1.5
2.1.5
cakephp/cakephp
Packagist
≥ 2.2.0-beta
< 2.2.1
2.2.1

References

Frequently Asked Questions

What is CVE-2012-4399?
CVE-2012-4399 is a security vulnerability in Cakephp/cakephp involving CakePHPallows remote attackers to read arbitrary files via XML data containing external entity references under CWE-611: Improper Restriction of XML External Entity Reference.
Which Cakephp/cakephp versions are affected?
Affected versions include releases prior to 2.1.5, 2.2.1 across affected packages: cakephp/cakephp.
What version fixes CVE-2012-4399?
Upgrading to 2.1.5, 2.2.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cakephp/cakephp affected?
Yes, cakephp/cakephp is affected in releases prior to 2.1.5, 2.2.1. Upgrade your dependency to 2.1.5, 2.2.1 or later.
What is the CVSS score of CVE-2012-4399?
CVE-2012-4399 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2012-4399?
CVE-2012-4399 is classified under CWE-611: Improper Restriction of XML External Entity Reference (The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.).
How can I check Packagist dependencies for CVE-2012-4399?
Run the dependency tree command: 'inspect dependencies for cakephp/cakephp'. 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-5964-pq8r-4q62",
  "modified" : "2024-04-09T14:17:43Z",
  "published" : "2022-05-17T05:07:14Z",
  "aliases" : [ "CVE-2012-4399" ],
  "summary" : "CakePHPallows remote attackers to read arbitrary files via XML data containing external entity references",
  "details" : "The Xml class in CakePHP 2.1.x before 2.1.5 and 2.2.x before 2.2.1 allows remote attackers to read arbitrary files via XML data containing external entity references, aka an XML external entity (XXE) injection attack.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/cakephp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.1.0-alpha"
      }, {
        "fixed" : "2.1.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "cakephp/cakephp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.2.0-beta"
      }, {
        "fixed" : "2.2.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2012-4399"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cakephp/cakephp"
  }, {
    "type" : "WEB",
    "url" : "http://bakery.cakephp.org/articles/markstory/2012/07/14/security_release_-_cakephp_2_1_5_2_2_1"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/bugtraq/2012/Jul/101"
  }, {
    "type" : "WEB",
    "url" : "http://secunia.com/advisories/49900"
  }, {
    "type" : "WEB",
    "url" : "http://www.exploit-db.com/exploits/19863"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2012/09/03/1"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2012/09/03/2"
  }, {
    "type" : "WEB",
    "url" : "http://www.osvdb.org/84042"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-14T05:30:14Z",
    "nvd_published_at" : "2012-10-09T23:55:00Z"
  }
}