CVE-2015-5161: Zendframework/zendframework ZendXml And Zend Framework Contain Vulnerability

MODERATE
Advisory Identifier: GHSA-xp8p-9rq5-4wgv
CWE-776 CWE-611
Published
Advisory Summary

CVE-2015-5161 is a MODERATE zendxml and zend framework contain vulnerability (CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')) affecting Zendframework/zendframework libraries in the Packagist ecosystem. The issue involves zendxml and zend framework contain xxe and xee vulnerabilities. Remediation is available by upgrading affected packages to version 2.4.6, 2.5.2, 1.12.14, 1.0.1.

CVE-2015-5161 at a Glance

CVE Identifier CVE-2015-5161
GHSA Identifier GHSA-xp8p-9rq5-4wgv
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')
Affected Product Zendframework/zendframework
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2015-5161

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.4.6
Upgrade zendframework/zendframework to 2.4.6
zendframework/zendframework fixed: 2.5.2
Upgrade zendframework/zendframework to 2.5.2
zendframework/zendframework1 fixed: 1.12.14
Upgrade zendframework/zendframework1 to 1.12.14
zendframework/zendxml fixed: 1.0.1
Upgrade zendframework/zendxml to 1.0.1
zendframework/zendframework fixed: 1.12.14
Upgrade zendframework/zendframework to 1.12.14
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 CVE-2015-5161, 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.4.6), 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-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion'), where the product uses xml documents and allows their structure to be defined with a document type definition (dtd), but it does not properly control the number of recursive definitions of entities. 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

The `Zend_Xml_Security::scan` in ZendXml before 1.0.1 and Zend Framework before 1.12.14, 2.x before 2.4.6, and 2.5.x before 2.5.2, when running under PHP-FPM in a threaded environment, allows remote attackers to bypass security checks and conduct XML external entity (XXE) and XML entity expansion (XEE) attacks via multibyte encoded characters.

CVE-2015-5161 Affected Zendframework/zendframework Versions

5 component(s)
Fixed Versions:
2.4.62.5.21.12.141.0.1
Product / Package Ecosystem Affected Versions Fixed Version
zendframework/zendframework
Packagist
≥ 2.0.0
< 2.4.6
2.4.6
zendframework/zendframework
Packagist
≥ 2.5.0
< 2.5.2
2.5.2
zendframework/zendframework1
Packagist
≥ 1.12.0
< 1.12.14
1.12.14
zendframework/zendxml
Packagist
≥ 1.0.0
< 1.0.1
1.0.1
zendframework/zendframework
Packagist
≥ 1.12.0
< 1.12.14
1.12.14

References

NVD — CVE-2015-5161 NVD
https://nvd.nist.gov/vuln/detail/CVE-2015-5161
Zendframework/zendframework Source Repository REPOSITORY
https://github.com/zendframework/zf1/issues/393
Security Fix Commit FIX COMMIT
https://github.com/zendframework/ZendXml/commit/79f478fa2af85ce1fc18ac132dee5aa714c3b532
Security Fix Commit FIX COMMIT
https://github.com/zendframework/zf1/commit/ff7edddf1410b44b5ead857c02698aad9f748d1b
Zendframework/zendframework Security Information SECURITY
https://framework.zend.com/security/advisory/ZF2015-06
Zendframework/zendframework Source Repository REPOSITORY
https://github.com/FriendsOfPHP/security-advisories/blob/master/zendframework/zendframework/CVE-2015-5161.yaml
Zendframework/zendframework Source Repository REPOSITORY
https://github.com/FriendsOfPHP/security-advisories/blob/master/zendframework/zendframework1/CVE-2015-5161.yaml
Zendframework/zendframework Source Repository REPOSITORY
https://github.com/FriendsOfPHP/security-advisories/blob/master/zendframework/zendxml/CVE-2015-5161.yaml
Zendframework/zendframework Security Information SECURITY
https://web.archive.org/web/20200228055156/http://www.securityfocus.com/bid/76177
www.exploit-db.com/exploits/37765 WEB
https://www.exploit-db.com/exploits/37765
Zendframework/zendframework Security Information SECURITY
http://framework.zend.com/security/advisory/ZF2015-06
legalhackers.com/advisories/zend-fra... WEB
http://legalhackers.com/advisories/zend-framework-XXE-vuln.txt
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2015-August/164409.html
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2015-August/165147.html
lists.fedoraproject.org/pipermail/package-a... WEB
http://lists.fedoraproject.org/pipermail/package-announce/2015-August/165173.html
Zendframework/zendframework Security Information SECURITY
http://packetstormsecurity.com/files/133068/Zend-Framework-2.4.2-1.12.13-XXE-Injection.html
seclists.org/fulldisclosure/2015... WEB
http://seclists.org/fulldisclosure/2015/Aug/46
Zendframework/zendframework Security Information SECURITY
http://www.debian.org/security/2015/dsa-3340
Zendframework/zendframework Security Information SECURITY
http://www.securityfocus.com/bid/76177

Frequently Asked Questions

What is CVE-2015-5161?
CVE-2015-5161 is a security vulnerability in Zendframework/zendframework involving ZendXml and Zend Framework contain XXE and XEE Vulnerabilities under CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion').
Which Zendframework/zendframework versions are affected?
Affected versions include releases prior to 2.4.6, 2.5.2, 1.12.14, 1.0.1 across affected packages: zendframework/zendframework, zendframework/zendframework1, zendframework/zendxml.
What version fixes CVE-2015-5161?
Upgrading to 2.4.6, 2.5.2, 1.12.14, 1.0.1 (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.4.6, 2.5.2, 1.12.14. Upgrade your dependency to 2.4.6, 2.5.2, 1.12.14 or later.
Is zendframework/zendframework1 affected?
Yes, zendframework/zendframework1 is affected in releases prior to 1.12.14. Upgrade your dependency to 1.12.14 or later.
What CWE is associated with CVE-2015-5161?
CVE-2015-5161 is classified under CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion') (The product uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.).
How can I check Packagist dependencies for CVE-2015-5161?
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-xp8p-9rq5-4wgv",
  "modified" : "2023-08-03T21:53:46Z",
  "published" : "2022-05-17T03:16:37Z",
  "aliases" : [ "CVE-2015-5161" ],
  "summary" : "ZendXml and Zend Framework contain XXE and XEE Vulnerabilities",
  "details" : "The `Zend_Xml_Security::scan` in ZendXml before 1.0.1 and Zend Framework before 1.12.14, 2.x before 2.4.6, and 2.5.x before 2.5.2, when running under PHP-FPM in a threaded environment, allows remote attackers to bypass security checks and conduct XML external entity (XXE) and XML entity expansion (XEE) attacks via multibyte encoded characters.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "zendframework/zendframework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.4.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "zendframework/zendframework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.5.0"
      }, {
        "fixed" : "2.5.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "zendframework/zendframework1"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.12.0"
      }, {
        "fixed" : "1.12.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "zendframework/zendxml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "1.0.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "zendframework/zendframework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.12.0"
      }, {
        "fixed" : "1.12.14"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-5161"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zendframework/zf1/issues/393"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zendframework/ZendXml/commit/79f478fa2af85ce1fc18ac132dee5aa714c3b532"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zendframework/zf1/commit/ff7edddf1410b44b5ead857c02698aad9f748d1b"
  }, {
    "type" : "WEB",
    "url" : "https://framework.zend.com/security/advisory/ZF2015-06"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/zendframework/zendframework/CVE-2015-5161.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/zendframework/zendframework1/CVE-2015-5161.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/zendframework/zendxml/CVE-2015-5161.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200228055156/http://www.securityfocus.com/bid/76177"
  }, {
    "type" : "WEB",
    "url" : "https://www.exploit-db.com/exploits/37765"
  }, {
    "type" : "WEB",
    "url" : "http://framework.zend.com/security/advisory/ZF2015-06"
  }, {
    "type" : "WEB",
    "url" : "http://legalhackers.com/advisories/zend-framework-XXE-vuln.txt"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2015-August/164409.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2015-August/165147.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2015-August/165173.html"
  }, {
    "type" : "WEB",
    "url" : "http://packetstormsecurity.com/files/133068/Zend-Framework-2.4.2-1.12.13-XXE-Injection.html"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2015/Aug/46"
  }, {
    "type" : "WEB",
    "url" : "http://www.debian.org/security/2015/dsa-3340"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/76177"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611", "CWE-776" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-03T21:53:46Z",
    "nvd_published_at" : "2015-08-25T17:59:00Z"
  }
}