CVE-2021-47751 Overview
CVE-2021-47751 is a directory traversal vulnerability in CuteEditor for PHP (now referred to as Rich Text Editor) version 6.6. The vulnerability exists in the browse template feature, allowing authenticated attackers to write files to arbitrary web root directories. By exploiting the ServerMapPath() function with directory traversal sequences when renaming uploaded HTML files, attackers can write files outside the intended template directory, potentially leading to arbitrary file write and remote code execution scenarios.
Critical Impact
Attackers with low privileges can write arbitrary files to web root directories, potentially enabling web shell deployment and full server compromise.
Affected Products
- CuteEditor for PHP (Rich Text Editor) version 6.6
- Installations using the vulnerable browse template feature
- Web applications integrating CuteEditor with file upload functionality
Discovery Timeline
- 2026-01-13 - CVE CVE-2021-47751 published to NVD
- 2026-01-13 - Last updated in NVD database
Technical Details for CVE-2021-47751
Vulnerability Analysis
This directory traversal vulnerability (CWE-22) affects the file rename functionality within CuteEditor for PHP's browse template feature. The core issue lies in the ServerMapPath() function, which fails to properly sanitize user-supplied input during file rename operations. When a user uploads an HTML file through the template browser, the application allows renaming of that file without validating that the new filename contains directory traversal sequences such as ../ or ..\\.
The vulnerability allows an authenticated attacker with access to the template browsing functionality to write files outside the designated template directory. By crafting a malicious rename request with path traversal characters, an attacker can place files in arbitrary locations within the web root, including directories that may be publicly accessible or executed by the web server.
Root Cause
The root cause is improper input validation in the ServerMapPath() function. The function processes user-controlled filename input without adequately filtering or rejecting directory traversal sequences. When processing a file rename request, the application concatenates the user-supplied filename directly with the base path, allowing relative path components to escape the intended directory boundary.
Attack Vector
The attack is network-based and requires low privilege authentication to access the template browsing feature. An attacker would:
- Authenticate to the application with access to CuteEditor's template browser
- Upload a legitimate HTML file through the normal upload functionality
- Initiate a rename operation on the uploaded file
- Supply a malicious filename containing directory traversal sequences (e.g., ../../../webroot/shell.php)
- The ServerMapPath() function processes the path without sanitization
- The file is written to the attacker-specified location outside the template directory
This vulnerability can be chained with file upload functionality to achieve remote code execution by placing a malicious PHP file in an executable web directory.
Detection Methods for CVE-2021-47751
Indicators of Compromise
- Unexpected files appearing in web root directories outside the CuteEditor template folder
- HTTP requests to CuteEditor rename endpoints containing ../ or encoded variants (%2e%2e%2f)
- Newly created PHP, ASP, or other executable files in unexpected locations
- Web server logs showing access to the browse template functionality with suspicious path patterns
Detection Strategies
- Monitor web application logs for requests containing directory traversal patterns in file rename operations
- Implement file integrity monitoring on web root directories to detect unauthorized file creation
- Deploy web application firewall (WAF) rules to block requests with path traversal sequences
- Audit CuteEditor configuration and access logs for suspicious template browsing activity
Monitoring Recommendations
- Enable detailed logging for all CuteEditor file operations including uploads and renames
- Configure alerts for file creation events in sensitive web directories
- Regularly review file system permissions to ensure CuteEditor cannot write outside designated directories
- Monitor for outbound connections from web server that may indicate successful exploitation
How to Mitigate CVE-2021-47751
Immediate Actions Required
- Restrict access to the CuteEditor template browsing feature to only trusted administrators
- Review and remove any suspicious files that may have been written to web directories
- Implement web application firewall rules to block directory traversal attempts
- Consider disabling the template browse and rename functionality until a patch is available
Patch Information
No official patch information is available at this time. Organizations should consult the PHP HTML Editor official website for updates on security fixes. Additional technical details and exploit information can be found in the Exploit-DB #50994 entry and the VulnCheck Advisory for CuteEditor.
Workarounds
- Disable the template browse feature entirely if not required for business operations
- Implement strict input validation at the web server or proxy level to reject filenames containing ../ sequences
- Configure file system permissions to prevent the web application from writing outside the template directory
- Use a reverse proxy or WAF to filter malicious rename requests before they reach the application
- Consider migrating to an alternative rich text editor that does not have this vulnerability
# Example: Restrict file system permissions for CuteEditor directories
# Ensure the web server user can only write to the designated template directory
chmod 755 /var/www/html/cuteeditor/
chmod 700 /var/www/html/cuteeditor/templates/
chown www-data:www-data /var/www/html/cuteeditor/templates/
# Add .htaccess to prevent PHP execution in template directory
echo "php_flag engine off" > /var/www/html/cuteeditor/templates/.htaccess
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


