CVE-2021-3007: Zendframework/zendframework Remote Code Execution Vulnerability
CRITICALCVE-2021-3007 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Zendframework/zendframework libraries in the Packagist ecosystem. The issue involves remote code execution in zendframework and laminas-http. Remediation is available by upgrading affected packages to version 2.14.2.
CVE-2021-3007 at a Glance
Security Impact
CVSS: 9.8
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:H/A:H).
How to Fix CVE-2021-3007
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.
Upgrade zendframework/zendframework to Latest secure release
Upgrade laminas/laminas-http to 2.14.2
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-2021-3007, 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.14.2), 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. 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
CVE-2021-3007 Affected Zendframework/zendframework Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
zendframework/zendframework
|
Packagist |
≤ 3.0.0
|
|
|
laminas/laminas-http
|
Packagist |
< 2.14.2
|
2.14.2
|
References
Frequently Asked Questions
What is CVE-2021-3007?
Which Zendframework/zendframework versions are affected?
What version fixes CVE-2021-3007?
Is zendframework/zendframework affected?
Is laminas/laminas-http affected?
What is the CVSS score of CVE-2021-3007?
What CWE is associated with CVE-2021-3007?
How can I check Packagist dependencies for CVE-2021-3007?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xx8f-qf9f-5fgw",
"modified" : "2024-04-22T19:04:05Z",
"published" : "2021-06-08T20:11:19Z",
"aliases" : [ "CVE-2021-3007" ],
"summary" : "Remote code execution in zendframework and laminas-http",
"details" : "Laminas Project laminas-http before 2.14.2, and Zend Framework 3.0.0, has a deserialization vulnerability that can lead to remote code execution if the content is controllable, related to the __destruct method of the Zend\\Http\\Response\\Stream class in Stream.php. NOTE: Zend Framework is no longer supported by the maintainer. NOTE: the laminas-http vendor considers this a \"vulnerability in the PHP language itself\" but has added certain type checking as a way to prevent exploitation in (unrecommended) use cases where attacker-supplied data can be deserialized.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "zendframework/zendframework"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "3.0.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "laminas/laminas-http"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.14.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-3007"
}, {
"type" : "WEB",
"url" : "https://github.com/laminas/laminas-http/pull/48"
}, {
"type" : "WEB",
"url" : "https://github.com/Ling-Yizhou/zendframework3-/blob/main/zend%20framework3%20%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%20rce.md"
}, {
"type" : "WEB",
"url" : "https://github.com/laminas/laminas-http/commits/2.15.x/src/Response/Stream.php"
}, {
"type" : "WEB",
"url" : "https://github.com/laminas/laminas-http/releases/tag/2.14.2"
}, {
"type" : "WEB",
"url" : "https://research.checkpoint.com/2021/freakout-leveraging-newest-vulnerabilities-for-creating-a-botnet"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-502" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2021-04-07T18:11:15Z",
"nvd_published_at" : "2021-01-04T03:15:00Z"
}
}