CVE-2024-8502

9.8 CRITICAL

📋 TL;DR

This vulnerability allows remote attackers to execute arbitrary code on servers running modelscope/agentscope v0.0.6a3 by sending malicious serialized data to the RPC agent server. The deserialization of untrusted data using the dill library enables complete system compromise. Any organization using the vulnerable version with the RPC agent server exposed is affected.

💻 Affected Systems

Products:
  • modelscope/agentscope
Versions: v0.0.6a3
Operating Systems: All operating systems running Python
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems where the RPC agent server is running and accessible. The vulnerability is in the AgentServerServicer.create_agent method.

⚠️ 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.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full system compromise allowing attacker to execute arbitrary commands, steal data, install malware, pivot to other systems, and maintain persistent access.

🟠

Likely Case

Remote code execution leading to data exfiltration, service disruption, and potential lateral movement within the network.

🟢

If Mitigated

Limited impact if proper network segmentation and access controls prevent exploitation attempts.

🌐 Internet-Facing: HIGH - The vulnerability allows unauthenticated remote code execution on exposed services.
🏢 Internal Only: HIGH - Even internally, the vulnerability provides full system compromise capabilities.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

The vulnerability is straightforward to exploit as it involves sending malicious serialized payloads to the vulnerable endpoint. Public proof-of-concept exists on huntr.com.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v0.0.6a4 or later

Vendor Advisory: https://huntr.com/bounties/7a42da2a-2ae5-442d-aff9-c9a3b47870eb

Restart Required: Yes

Instructions:

1. Update modelscope/agentscope to version v0.0.6a4 or later. 2. Restart all agent server instances. 3. Verify the patch is applied by checking the version.

🔧 Temporary Workarounds

Network Isolation

linux

Restrict network access to the RPC agent server using firewall rules

iptables -A INPUT -p tcp --dport [AGENT_PORT] -j DROP
ufw deny [AGENT_PORT]

Disable RPC Agent Server

all

Stop using the vulnerable RpcAgentServerLauncher class if not required

systemctl stop agentscope-rpc
pkill -f 'python.*agentscope.*rpc'

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate the vulnerable service from untrusted networks
  • Deploy application-level firewalls or WAFs to inspect and block malicious serialized payloads

🔍 How to Verify

Check if Vulnerable:

Check if agentscope version is v0.0.6a3 and RPC agent server is running. Review logs for deserialization errors or unexpected process creation.

Check Version:

python -c "import agentscope; print(agentscope.__version__)"

Verify Fix Applied:

Confirm agentscope version is v0.0.6a4 or later. Test that dill.loads no longer processes untrusted input in AgentServerServicer.create_agent.

📡 Detection & Monitoring

Log Indicators:

  • Unusual deserialization errors
  • Unexpected process creation from agent server
  • Large or malformed serialized data in RPC requests

Network Indicators:

  • Unusual outbound connections from agent server
  • Suspicious payloads to RPC agent port
  • Anomalous network traffic patterns

SIEM Query:

source="agent-server" AND (event="deserialization_error" OR process="unexpected_executable")

🔗 References

📤 Share & Export