CVE-2023-1721
📋 TL;DR
Yoga Class Registration System 1.0 contains an unrestricted file upload vulnerability that allows authenticated administrators to upload malicious files disguised as class thumbnails, leading to remote code execution on the server. This affects any organization using this specific PHP application version. Attackers with administrator credentials can gain complete control of the web server.
💻 Affected Systems
- Yoga Class Registration System
📦 What is this software?
Yoga Class Registration System by Yoga Class Registration System Project
⚠️ Risk & Real-World Impact
Worst Case
Full server compromise allowing attackers to execute arbitrary commands, steal data, install malware, pivot to internal networks, and maintain persistent access.
Likely Case
Attackers upload web shells to gain remote code execution, potentially leading to data theft, defacement, or use as a foothold for further attacks.
If Mitigated
With proper file upload validation and administrator account security, impact is limited to potential file uploads but not code execution.
🎯 Exploit Status
Exploitation requires administrator credentials but is straightforward once authenticated. Public advisories detail the vulnerability.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Not available
Vendor Advisory: Not available
Restart Required: No
Instructions:
No official patch exists. Consider replacing with alternative software or implementing custom fixes.
🔧 Temporary Workarounds
Implement strict file upload validation
allAdd server-side validation to restrict uploaded files to allowed image types only, verify file signatures, and rename files to prevent execution.
Modify PHP upload handling code to include: $allowed_types = ['image/jpeg', 'image/png', 'image/gif']; $file_info = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $_FILES['thumbnail']['tmp_name']); if (!in_array($file_info, $allowed_types)) { die('Invalid file type'); }
Restrict upload directory permissions
linuxConfigure web server to prevent execution of uploaded files in the thumbnails directory.
For Apache: Add 'php_flag engine off' to .htaccess in upload directory
For Nginx: location ~* \.(php)$ { deny all; } in upload directory config
🧯 If You Can't Patch
- Disable administrator file upload functionality entirely in the application
- Implement web application firewall (WAF) rules to block malicious file uploads and monitor for suspicious administrator activity
🔍 How to Verify
Check if Vulnerable:
Check if Yoga Class Registration System version 1.0 is installed and if administrators can upload files without proper validation. Test by uploading a PHP file disguised as an image.
Check Version:
Check application files for version information, typically in config files or footer. Look for 'version 1.0' in source code.
Verify Fix Applied:
Attempt to upload a malicious file (e.g., .php with image extension) as administrator. If upload is blocked or file cannot be executed, fix is working.
📡 Detection & Monitoring
Log Indicators:
- Unusual file uploads by administrators, especially files with double extensions (.jpg.php)
- Execution of unexpected PHP files from upload directories
- Failed upload attempts with suspicious file types
Network Indicators:
- HTTP POST requests to upload endpoints with unusual file content
- Subsequent requests to uploaded files in thumbnails directory
SIEM Query:
source="web_logs" AND (uri_path="/upload.php" OR uri_path="/admin/upload") AND (file_extension="php" OR file_extension="phtml" OR content_type!~"image/")
🔗 References
- https://fluidattacks.com/advisories/blessd/
- https://www.sourcecodester.com/php/16097/yoga-class-registration-system-php-and-mysql-free-source-code.html
- https://fluidattacks.com/advisories/blessd/
- https://www.sourcecodester.com/php/16097/yoga-class-registration-system-php-and-mysql-free-source-code.html