Remote code execution in zendframework and laminas-http
Impact
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.
Source excerpt · OSVAffected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
| Affected range | Recorded fix |
|---|---|
| Earlier releases through 3.0.0 (inclusive)Ecosystem versions | Not recorded |
Version evidence: OSV · GHSA-xx8f-qf9f-5fgw
View original version evidence (75 explicit versions)
| Affected range | Recorded fix |
|---|---|
| Earlier releases before 2.14.2Ecosystem versions | 2.14.2 |
Version evidence: OSV · GHSA-xx8f-qf9f-5fgw
View original version evidence (87 explicit versions)
Original source description
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.
References
- Security advisory nvd.nist.gov/vuln/detail/CVE-2021-3007
- Patch github.com/laminas/laminas-http/pull/48
- Source reference github.com/Ling-Yizhou/zendframework3-/blob/main/zend%20framework3%20%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%20rce.md
- Source reference github.com/laminas/laminas-http/commits/2.15.x/src/Response/Stream.php
- Release notes github.com/laminas/laminas-http/releases/tag/2.14.2
- Security advisory research.checkpoint.com/2021/freakout-leveraging-newest-vulnerabilities-for-creating-a-botnet