CVE-2021-21247
📋 TL;DR
This vulnerability allows authenticated attackers to achieve remote code execution on OneDev DevOps platforms by exploiting insecure deserialization in AJAX event listeners. It affects all OneDev instances before version 4.0.3 where users can submit POST requests to any page. Attackers need valid user credentials to exploit this post-authentication vulnerability.
💻 Affected Systems
- OneDev
📦 What is this software?
Onedev by Onedev Project
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise allowing attackers to execute arbitrary code, access sensitive data, modify configurations, and potentially pivot to other systems in the network.
Likely Case
Authenticated attackers gaining shell access to the OneDev server, potentially leading to data theft, service disruption, or lateral movement within the network.
If Mitigated
Limited impact with proper network segmentation, strong authentication controls, and monitoring that detects unusual POST requests to AJAX endpoints.
🎯 Exploit Status
Exploitation requires valid user credentials but is straightforward once authenticated. The advisory includes technical details that facilitate exploit development.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 4.0.3
Vendor Advisory: https://github.com/theonedev/onedev/security/advisories/GHSA-6pxf-75cf-vwjp
Restart Required: Yes
Instructions:
1. Backup your OneDev instance and data. 2. Download and install OneDev version 4.0.3 or later from the official repository. 3. Restart the OneDev service. 4. Verify the update was successful by checking the version.
🔧 Temporary Workarounds
Network Access Restriction
allRestrict access to OneDev to trusted IP addresses only
Configure firewall rules to allow only specific IP ranges to access OneDev ports
Authentication Hardening
allImplement strong authentication controls and monitor for suspicious user activity
Enable MFA for all users
Implement account lockout policies
Review and remove unnecessary user accounts
🧯 If You Can't Patch
- Implement strict network segmentation to isolate OneDev from critical systems
- Deploy web application firewall (WAF) rules to block suspicious POST requests with serialized data payloads
🔍 How to Verify
Check if Vulnerable:
Check OneDev version via web interface or configuration files. If version is below 4.0.3, the system is vulnerable.
Check Version:
Check the OneDev web interface admin panel or examine the installation directory for version information
Verify Fix Applied:
Verify the version is 4.0.3 or higher and test that serialized payloads in POST requests are properly rejected or encrypted.
📡 Detection & Monitoring
Log Indicators:
- Unusual POST requests to AJAX endpoints
- Multiple failed authentication attempts followed by successful login and POST requests
- Log entries showing deserialization errors or unusual process execution
Network Indicators:
- POST requests containing serialized Java objects in query parameters
- Unusual outbound connections from OneDev server to external systems
SIEM Query:
source="onedev" AND (http_method="POST" AND uri="*ajax*" AND query="*data=*" AND size>1000) OR (process_execution="cmd.exe" OR process_execution="/bin/bash")