Apr 14, 2026·6 min read·84 visits
A typo in the file extension whitelist property ('allowExts' instead of 'exts') in ShowDoc's image upload endpoint permits unauthenticated attackers to upload PHP files, resulting in remote code execution.
ShowDoc versions prior to 2.8.7 are vulnerable to a critical unrestricted file upload vulnerability due to an incorrect property configuration in the ThinkPHP file upload class. This allows unauthenticated attackers to upload arbitrary PHP web shells and achieve remote code execution.
ShowDoc versions prior to 2.8.7 contain a critical unrestricted file upload vulnerability identified as CVE-2025-0520. The flaw exists in the image upload endpoint accessible via the URI path /index.php?s=/home/page/uploadImg. This endpoint fails to validate file extensions correctly before saving user-supplied files to the server filesystem.
The validation failure stems from a misconfiguration in the implementation of the underlying ThinkPHP framework. The framework defaults to a permissive state, allowing all file extensions when the validation property is incorrectly specified or omitted entirely. The developer's incorrect property assignment overrides the intended security controls.
Unauthenticated attackers exploit this vulnerability to upload arbitrary PHP scripts to the target server. The application stores these uploaded scripts in a publicly accessible directory without stripping execution privileges. Successful exploitation results in arbitrary remote code execution within the context of the web server process.
This vulnerability affects all default installations of ShowDoc prior to the patched version. The flaw exposes affected systems to complete compromise, allowing attackers to establish persistent access, manipulate internal databases, and pivot into adjacent network segments.
The vulnerability originates in the uploadImg method of the PageController class. The development team attempted to enforce a whitelist of safe image extensions for user uploads. To implement this restriction, the code instantiated the Think\Upload class from the ThinkPHP 3.x framework.
The developer assigned the array of permitted extensions (jpg, gif, png, jpeg) to a property named allowExts. The ThinkPHP 3.x framework expects the extension whitelist to be defined using the property exts. Because allowExts is an unrecognized property, the framework silently ignored the configuration assignment.
Consequently, the upload class operated with an empty extension restriction list. The framework logic permits all file types by default when no explicit restrictions are configured. This architectural behavior is designed to allow developers to build generic upload handlers, but it introduces severe risks when intended restrictions fail to apply.
The application logic relies entirely on the ThinkPHP class for file validation before moving the temporary upload to its final destination. Since the framework validation passes successfully for all extensions, the application proceeds to write the file, enabling the upload of executable PHP scripts directly to the web root.
The vulnerable implementation resides in server/Application/Home/Controller/PageController.class.php. The instantiation of the upload handler explicitly demonstrates the property name error. The code defines a maximum file size and attempts to define the allowed extensions before invoking the upload() method.
public function uploadImg(){
// ...
$upload = new \Think\Upload();
$upload->maxSize = 3145728 ;
$upload->allowExts = array('jpg', 'gif', 'png', 'jpeg'); // INCORRECT PROPERTY
$upload->rootPath = './Public/Uploads/';
$upload->savePath = '';
$info = $upload->upload();
// ...
}The framework documentation confirms exts is the correct property for array-based extension validation in ThinkPHP 3.x. The incorrect property assignment left the upload process entirely unrestricted. The patch resolves this by correcting the property name to exts.
--- a/server/Application/Home/Controller/PageController.class.php
+++ b/server/Application/Home/Controller/PageController.class.php
@@ -147,7 +147,7 @@ public function uploadImg(){
}else{
$upload = new \Think\Upload();
$upload->maxSize = 3145728 ;
- $upload->allowExts = array('jpg', 'gif', 'png', 'jpeg');
+ $upload->exts = array('jpg', 'gif', 'png', 'jpeg');
$upload->rootPath = './Public/Uploads/';
$upload->savePath = '';
$info = $upload->upload() ;This simple syntactic correction restores the core validation mechanism. Attackers attempting to upload .php files after this patch will face a validation rejection from the framework before the file is written to disk. The upload method will return a failure state, preventing the malicious file creation.
Exploitation requires network access to the vulnerable ShowDoc instance. The attacker does not need prior authentication or specific privileges, making this a zero-click remote vector for unauthenticated users. The /index.php?s=/home/page/uploadImg endpoint handles the payload delivery.
The attack sequence begins with crafting a standard multipart/form-data POST request. The request targets the upload endpoint and includes a PHP web shell as the payload within the editormd-image-file parameter. The filename is explicitly set with a .php extension.
POST /index.php?s=/home/page/uploadImg HTTP/1.1
Host: <target-ip>:8080
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryExploit
Connection: close
------WebKitFormBoundaryExploit
Content-Disposition: form-data; name="editormd-image-file"; filename="shell.php"
Content-Type: text/plain
<?php phpinfo(); ?>
------WebKitFormBoundaryExploit--The server processes the request and writes the payload to the Public/Uploads/ directory. The application then returns a JSON response containing the exact path to the newly created file, typically structured as {"success":1, "url":"/Public/Uploads/[date]/[hash].php"}.
The attacker issues a subsequent GET request to the URL provided in the JSON response to execute the web shell. This execution grants the attacker command execution capabilities on the underlying operating system.
The vulnerability allows an unauthenticated attacker to achieve arbitrary code execution. This represents a complete compromise of the application's confidentiality, integrity, and availability. The executed code runs with the privileges of the web server process (e.g., www-data or apache).
An attacker can leverage this access to read sensitive configuration files, including database credentials. The access also permits the modification or deletion of existing documentation stored within ShowDoc, directly impacting organizational knowledge bases.
The CVSS v4.0 base score is 9.4, reflecting the critical severity of unauthenticated remote code execution. The high score is driven by the minimal attack complexity, the lack of authentication requirements, and the severe downstream impact on the host system.
The EPSS score of 0.01614 places this vulnerability in the 81.78th percentile for expected exploitation. The availability of public proof-of-concept exploits and documented active exploitation significantly elevates the immediate risk profile for internet-facing installations.
The primary remediation strategy is upgrading ShowDoc to version 2.8.7 or later. This version contains the corrected property assignment and properly restricts file uploads to the intended image formats. Organizations should apply this update immediately to all accessible instances.
Administrators who cannot immediately apply the upgrade must manually modify the codebase. The fix requires opening the server/Application/Home/Controller/PageController.class.php file and changing the $upload->allowExts variable assignment to $upload->exts.
Network-level mitigations provide an additional layer of defense while patching is underway. Organizations should deploy Web Application Firewall (WAF) rules to intercept POST requests targeting the upload endpoint that contain executable file extensions in the filename field.
Security teams must review the Public/Uploads/ directory for existing .php, .php5, or .phtml files. Any executable files found in this directory indicate prior exploitation and require immediate incident response procedures, including server isolation and forensic analysis.
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:L/SC:H/SI:H/SA:L| Product | Affected Versions | Fixed Version |
|---|---|---|
ShowDoc ShowDoc | < 2.8.7 | 2.8.7 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-434 |
| Attack Vector | Network |
| CVSS v4.0 | 9.4 (Critical) |
| EPSS Percentile | 81.78% |
| Exploit Status | Active Exploitation / PoC Available |
| Authentication | None Required |
The product allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment.
An LDAP injection vulnerability exists in the centraldogma-server-auth-shiro module of LY Corporation Central Dogma before version 0.84.0. The search logic dynamically constructs LDAP search filters by interpolating user-provided usernames without escaping RFC 4515 metacharacters. Unauthenticated remote attackers can leverage this flaw to bypass authentication, enumerate directory hierarchies, and access unauthorized resources.
CVE-2026-11746 is a critical vulnerability in Central Dogma Server prior to version 0.84.0, where an embedded ZooKeeper replication secret silently falls back to a publicly known, hard-coded default string ('ch4n63m3'). Remote attackers with access to the replication network can authenticate as legitimate cluster peers, potentially leading to unauthorized data exposure, state manipulation, or complete cluster takeover.
A logical verification flaw in ZITADEL's external JWT Identity Provider validation allows attackers to bypass session expiration checks. If an incoming JWT lacks the 'exp' claim, the system skips validation entirely, creating an indefinitely valid session. This issue has been addressed in versions 3.4.12 and 4.15.2.
CVE-2026-59149 identifies a directory traversal vulnerability in `@mockoon/commons-server`, the backend mock-server library powering the Mockoon application. The flaw occurs in the path containment validation logic used during raw file response generation. An unauthenticated attacker can exploit this weakness to retrieve arbitrary files from sibling directories sharing a common prefix with the designated static base directory.
An in-depth analysis of CVE-2026-59148, a high-severity flaw in Mockoon where unauthenticated administrative endpoints and a wildcard Cross-Origin Resource Sharing (CORS) policy allow remote execution, state poisoning, and credential theft.
An improper authentication vulnerability (CWE-287) in ZITADEL's external identity provider handler before version 4.15.3 allows remote attackers to perform complete account takeover. When auto-linking by email is enabled, ZITADEL verifies that the local target account has a verified email address but fails to verify if the external provider confirmed ownership of that same email. Attackers can exploit this by registering an unverified account with a victim's email address on a permissive external provider, leading to unauthorized account binding and persistent access.