CVE-2021-32305
📋 TL;DR
CVE-2021-32305 is a critical remote code execution vulnerability in WebSVN that allows attackers to execute arbitrary commands on the server by injecting shell metacharacters into the search parameter. This affects all WebSVN installations before version 2.6.1. Attackers can gain full control of affected systems without authentication.
💻 Affected Systems
- WebSVN
📦 What is this software?
Websvn by Websvn
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise allowing attackers to execute arbitrary commands as the web server user, potentially leading to data theft, lateral movement, or installation of persistent backdoors.
Likely Case
Remote code execution leading to web server compromise, data exfiltration, and potential privilege escalation to gain full system control.
If Mitigated
Limited impact if proper input validation and command sanitization are implemented, restricting attackers to non-privileged operations.
🎯 Exploit Status
Exploitation is straightforward with publicly available proof-of-concept code. No authentication required.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 2.6.1
Vendor Advisory: https://github.com/websvnphp/websvn/pull/142
Restart Required: No
Instructions:
1. Backup current WebSVN installation. 2. Download WebSVN 2.6.1 or later from the official repository. 3. Replace the vulnerable files with the patched version. 4. Verify the installation is working correctly.
🔧 Temporary Workarounds
Input Validation Filter
allAdd input validation to sanitize search parameters before processing
Modify search.php to escape shell metacharacters using escapeshellarg() or similar functions
Web Application Firewall Rule
allBlock requests containing shell metacharacters in search parameters
Add WAF rule to block patterns like ;, |, &, $, (, ), {, }, `, >, < in search parameters
🧯 If You Can't Patch
- Disable the search functionality completely in WebSVN configuration
- Implement network segmentation to isolate WebSVN servers from critical systems
🔍 How to Verify
Check if Vulnerable:
Check if WebSVN version is below 2.6.1 by examining the version file or checking the web interface footer
Check Version:
grep -r 'version' /path/to/websvn/ | grep -i '2\.'
Verify Fix Applied:
Verify the version is 2.6.1 or higher and test search functionality with shell metacharacters to ensure they are properly escaped
📡 Detection & Monitoring
Log Indicators:
- Unusual search queries containing shell metacharacters (;, |, &, $, etc.)
- Multiple failed search attempts with special characters
- Commands executed from web server process that don't match normal operations
Network Indicators:
- HTTP requests to search.php with shell metacharacters in parameters
- Unusual outbound connections from web server to external IPs
SIEM Query:
source="webserver.log" AND (uri="*search.php*" AND (param="*;*" OR param="*|*" OR param="*&*" OR param="*$*" OR param="*`*"))