CVE-2024-21552
📋 TL;DR
CVE-2024-21552 allows arbitrary code execution on SuperAGI servers through unsafe use of the 'eval' function. Attackers can manipulate LLM outputs to execute malicious code on the application server. All SuperAGI users running vulnerable versions are affected.
💻 Affected Systems
- SuperAGI
⚠️ Manual Verification Required
This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.
Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).
🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.
- Review the CVE details at NVD
- Check vendor security advisories for your specific version
- Test if the vulnerability is exploitable in your environment
- Consider updating to the latest version as a precaution
⚠️ Risk & Real-World Impact
Worst Case
Complete server compromise allowing data theft, lateral movement, ransomware deployment, and persistent backdoor installation.
Likely Case
Server takeover leading to credential harvesting, data exfiltration, and use as a pivot point for further attacks.
If Mitigated
Limited impact with proper network segmentation and strict input validation, potentially preventing successful exploitation.
🎯 Exploit Status
Exploitation requires manipulating LLM output to trigger eval with malicious payloads. The vulnerability is straightforward to exploit once the attack vector is understood.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Not available
Vendor Advisory: Not available
Restart Required: No
Instructions:
1. Monitor SuperAGI GitHub repository for security updates
2. Apply patches immediately when available
3. Review and replace eval usage with safer alternatives
🔧 Temporary Workarounds
Remove eval usage
allReplace eval() calls in output_handler.py with safer alternatives like ast.literal_eval or custom parsing functions
# Edit superagi/agent/output_handler.py lines 149 and 180
# Replace eval() with safer alternatives
Input sanitization
allImplement strict input validation and sanitization for LLM outputs before processing
# Add validation functions to sanitize LLM outputs
# Implement allowlists for expected output patterns
🧯 If You Can't Patch
- Network segmentation: Isolate SuperAGI servers from critical systems and internet access
- Monitor and restrict: Implement strict monitoring of eval calls and restrict server permissions to minimal required access
🔍 How to Verify
Check if Vulnerable:
Check if superagi/agent/output_handler.py contains eval() calls at lines 149 and 180
Check Version:
# Check SuperAGI version if available in deployment
Verify Fix Applied:
Verify eval() calls have been removed or replaced with safe alternatives in output_handler.py
📡 Detection & Monitoring
Log Indicators:
- Unusual process execution from SuperAGI
- Suspicious eval calls with unexpected parameters
- Abnormal system command execution
Network Indicators:
- Unexpected outbound connections from SuperAGI server
- Command and control traffic patterns
SIEM Query:
process.name:python AND process.args:*eval* AND process.args:*SuperAGI*
🔗 References
- https://github.com/TransformerOptimus/SuperAGI/blob/9361f0491716e56bd0c0ae2f3b49da201a18c58c/superagi/agent/output_handler.py#L149
- https://github.com/TransformerOptimus/SuperAGI/blob/9361f0491716e56bd0c0ae2f3b49da201a18c58c/superagi/agent/output_handler.py#L180
- https://github.com/TransformerOptimus/SuperAGI/blob/9361f0491716e56bd0c0ae2f3b49da201a18c58c/superagi/agent/output_handler.py#L149
- https://github.com/TransformerOptimus/SuperAGI/blob/9361f0491716e56bd0c0ae2f3b49da201a18c58c/superagi/agent/output_handler.py#L180