CVE-2021-47751
Directory Traversal in CuteEditor PHP Allows Arbitrary File Write
Publication date: 2026-01-13
Last updated on: 2026-02-02
Assigner: VulnCheck
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| phphtmleditor | cuteeditor | to 6.6 (inc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-22 | The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability is a directory traversal flaw in CuteEditor for PHP version 6.6's browse template feature. It allows an attacker to exploit the ServerMapPath() function by renaming uploaded HTML files using directory traversal sequences (like "..\..\..\") to write files outside the intended template directory, such as arbitrary web root directories. This happens because the ServerMapPath() function inadequately sanitizes user input used in file renaming, enabling attackers to place malicious files in locations that can be accessed or executed by the web server. [1, 2]
How can this vulnerability impact me? :
This vulnerability can allow an attacker to write unauthorized files to arbitrary directories within the web root. This could lead to unauthorized file creation or modification, potentially enabling remote code execution or cross-site scripting (XSS) attacks if malicious HTML files are placed and accessed. Such impacts can compromise the security and integrity of the affected web application and server. [1, 2]
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by checking for the presence of files written outside the intended template directory, especially files with suspicious names containing directory traversal sequences (e.g., '..\..\..\poc.html' or '../'). One can look for unexpected HTML files in web root directories that may have been created or renamed via the CuteEditor browse template feature. Since the vulnerability involves the rename operation using ServerMapPath(), monitoring or logging rename operations in the /phphtmledit/cuteeditor_files/Dialogs/ directory could help detect exploitation attempts. Specific commands are not provided in the resources, but a practical approach would be to search for recently created or modified HTML files outside the template directory using commands like 'find' on Linux or 'dir /s /b' on Windows, filtering for suspicious filenames. For example, on Windows, you might run: dir C:\inetpub\wwwroot\*.html /s /t:w to find recently written HTML files. On Linux, a similar find command could be: find /var/www/html -name '*.html' -mtime -7 to find HTML files modified in the last 7 days. Additionally, reviewing web server logs for unusual rename or file upload activities related to CuteEditor endpoints may help detect exploitation. [1, 2]
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation steps include restricting access to the CuteEditor browse template feature to trusted users only, as the vulnerability requires attacker access to CuteEditor functions. Applying input validation or sanitization on the filename parameters used in the rename operation to prevent directory traversal sequences is critical. If a patch or updated version of CuteEditor is available that fixes the ServerMapPath() function to properly sanitize inputs, it should be applied promptly. Alternatively, disabling or restricting the 'rename file' feature in the browse template functionality can prevent exploitation. Monitoring and removing any unauthorized files written outside the intended directories is also recommended. Since the vulnerability allows writing files to arbitrary web root directories, ensuring proper file system permissions to prevent unauthorized file creation or modification can help mitigate impact. [1, 2]