CVE-2024-8556
📋 TL;DR
A stored cross-site scripting (XSS) vulnerability in modelscope/agentscope allows attackers to inject malicious JavaScript via user-controllable run IDs. This code executes in victims' browsers when they view detailed run information. Users of affected modelscope/agentscope installations are at risk.
💻 Affected Systems
- modelscope/agentscope
📦 What is this software?
Agentscope by Modelscope
⚠️ Risk & Real-World Impact
Worst Case
Attackers steal session cookies, perform actions as authenticated users, redirect to malicious sites, or install malware via drive-by downloads.
Likely Case
Session hijacking, credential theft, or unauthorized actions within the application context.
If Mitigated
Limited impact with proper content security policies and input validation, though some data exposure may still occur.
🎯 Exploit Status
Exploitation requires ability to create or manipulate run IDs, which typically requires some level of access to the application.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Not available
Vendor Advisory: Not available
Restart Required: No
Instructions:
1. Monitor the official modelscope/agentscope repository for security updates
2. Apply patches when available
3. Review commit history for security fixes
🔧 Temporary Workarounds
Input Validation and Sanitization
allImplement server-side validation and HTML encoding for all user-controlled run IDs before rendering in views.
Content Security Policy
allImplement strict CSP headers to prevent execution of inline scripts and unauthorized external resources.
🧯 If You Can't Patch
- Restrict access to run inspection functionality to trusted users only
- Implement web application firewall (WAF) rules to detect and block XSS payloads
🔍 How to Verify
Check if Vulnerable:
Test by creating a run with ID containing XSS payload like <script>alert('XSS')</script> and check if it executes when viewing run details.
Check Version:
Check git commit hash or version in application configuration
Verify Fix Applied:
Verify that user input is properly HTML-encoded in the run inspection view and XSS payloads no longer execute.
📡 Detection & Monitoring
Log Indicators:
- Unusual run IDs containing script tags or JavaScript code
- Multiple failed attempts with suspicious payloads
Network Indicators:
- Unexpected external script loads from run inspection pages
- Suspicious outbound connections after viewing run details
SIEM Query:
search 'run_id' AND ('<script>' OR 'javascript:' OR 'onload=' OR 'onerror=')