CVE-2022-47129
📋 TL;DR
PHPOK v6.3 contains a remote code execution vulnerability (CWE-94: Improper Control of Generation of Code) that allows attackers to execute arbitrary code on affected systems. This affects all installations running PHPOK v6.3. The high CVSS score of 9.8 indicates critical severity with low attack complexity.
💻 Affected Systems
- PHPOK
📦 What is this software?
Phpok by Phpok
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise allowing attackers to install malware, steal data, pivot to other systems, or establish persistent backdoors.
Likely Case
Attackers gain shell access to the web server, allowing them to deface websites, install cryptocurrency miners, or exfiltrate sensitive data.
If Mitigated
Limited impact with proper network segmentation, WAF rules, and minimal privileges, potentially containing the attack to the web server only.
🎯 Exploit Status
Public proof-of-concept exists in the provided GitHub gist. The vulnerability appears to be in template parsing functionality.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Unknown
Vendor Advisory: No official vendor advisory found
Restart Required: No
Instructions:
1. Check for official patch from PHPOK developers
2. If no patch available, upgrade to a newer version if compatible
3. Consider migrating to alternative CMS if PHPOK is no longer maintained
🔧 Temporary Workarounds
WAF Rule Implementation
allImplement web application firewall rules to block suspicious template parsing requests
Disable Template Editing
allRestrict access to template editing functionality if not required
🧯 If You Can't Patch
- Isolate the PHPOK instance in a separate network segment with strict egress filtering
- Implement application-level monitoring and alerting for suspicious file operations or command execution
🔍 How to Verify
Check if Vulnerable:
Check PHPOK version in admin panel or by examining source files. If version is 6.3, system is vulnerable.
Check Version:
Check PHPOK configuration files or admin panel for version information
Verify Fix Applied:
Verify version has been updated beyond 6.3 or that template parsing functionality has been secured.
📡 Detection & Monitoring
Log Indicators:
- Unusual POST requests to template-related endpoints
- Unexpected file creation in web directories
- Suspicious PHP execution patterns
Network Indicators:
- Outbound connections from web server to unknown IPs
- Unusual traffic patterns from web server
SIEM Query:
source="web_logs" AND (uri="*template*" OR uri="*phpok*" OR method="POST") AND status="200" AND size>10000
🔗 References
- https://gist.github.com/Omoredream/43f60004665e9d9d8c71f7e976261387
- https://www.yuque.com/g/alipayyz9csdbcdz/zytgq2/vz8ktghkcgvhsdzn/collaborator/join?token=R5phxzuV3w99ndZD
- https://gist.github.com/Omoredream/43f60004665e9d9d8c71f7e976261387
- https://www.yuque.com/g/alipayyz9csdbcdz/zytgq2/vz8ktghkcgvhsdzn/collaborator/join?token=R5phxzuV3w99ndZD