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

CVE-2023-3938

CVE-2023-3938 Improper Input Validation in Zkteco
📅 PUBLISHED: 2024-05-21 09:32 UTC 🔄 UPDATED: 2026-08-12 09:02 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: 0.14%
👁️
0.14% probability
3.4× above the median CVE
Tier: ELEVATED
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 4.6
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: L Confidentiality Low
I: L Integrity Low
A: N Availability None
4.6
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2023-3938 is an SQL Injection vulnerability affecting ZkTeco-based OEM devices, including the ZkTeco ProFace X, Smartec ST-FR043, and Smartec ST-FR041ME. The flaw resides in the authentication mechanism, allowing an unauthenticated attacker to bypass authentication and log in as any user present in the device database. With a CVSS score of 4.6 (Medium), the vulnerability enables unauthorized access but does not directly allow data exfiltration or remote code execution. The vendor has not released a patch, and no public proof-of-concept (PoC) or exploit code is available at this time. The EPSS score is 0.0%, indicating low exploitation activity in the wild.

⚡ 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 affects embedded firmware on physical OEM devices, making supply chain security a concern for organizations deploying these biometric access control systems. The lack of a patch and the OEM nature of the devices mean that end users are dependent on the original equipment manufacturer (ZkTeco) for remediation.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
  • Base Score: 4.6 (Medium)
  • Attack Vector: Network (AV:N) – The vulnerability can be exploited remotely over the network.
  • Attack Complexity: Low (AC:L) – No special conditions are required for exploitation.
  • Privileges Required: None (PR:N) – No authentication is needed to trigger the vulnerability.
  • User Interaction: None (UI:N) – The victim does not need to perform any action.
  • Scope: Unchanged (S:U) – The vulnerability does not affect other components.
  • Confidentiality Impact: Low (C:L) – Limited access to user data in the database.
  • Integrity Impact: Low (I:L) – The attacker can authenticate as any user, potentially modifying access control settings.
  • Availability Impact: None (A:N) – No denial-of-service impact.

Threat Level: Medium. The vulnerability allows authentication bypass but does not provide direct command execution or data exfiltration. However, in the context of physical access control systems, unauthorized authentication could lead to physical security breaches.

Deep Dive & Mechanics

The vulnerability is an SQL Injection in the authentication endpoint of the ZkTeco-based OEM devices. The device’s web interface or API likely accepts user credentials (e.g., username and password) and constructs an SQL query to validate them against the local database. Due to improper neutralization of special elements, an attacker can inject SQL commands into the input fields.

For example, if the authentication logic uses a query like:

SELECT * FROM users WHERE username = '$username' AND password = '$password'

An attacker can supply a username such as admin' OR '1'='1 and a password of ' OR '1'='1, resulting in:

SELECT * FROM users WHERE username = 'admin' OR '1'='1' AND password = '' OR '1'='1'

This query returns all rows, and the application may treat the first row as a successful authentication, granting the attacker access as the first user in the database (often an admin).

The vulnerability affects the authentication module, not the device’s core operating system. The attacker does not need to be on the same network segment; the device’s web interface is typically accessible over the network.

Vulnerable vs. Patched Code

Since no patch is available, a comparison cannot be made. However, a secure implementation would use parameterized queries or prepared statements. For example, in PHP (common in embedded web interfaces), the vulnerable code might look like:

Vulnerable Code (PHP):

$username = $_POST['username'];
$password = $_POST['password'];
$query = "SELECT * FROM users WHERE username = '$username' AND password = '$password'";
$result = mysqli_query($conn, $query);
if (mysqli_num_rows($result) > 0) {
    // authenticate user
}

Patched Code (PHP):

$username = $_POST['username'];
$password = $_POST['password'];
$stmt = $conn->prepare("SELECT * FROM users WHERE username = ? AND password = ?");
$stmt->bind_param("ss", $username, $password);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
    // authenticate user
}

The patched version uses prepared statements, which separate SQL logic from data, preventing injection.

Exploitation & Lab Setup

Red Team (Offensive)

Lab Setup:

  1. Obtain a vulnerable device (e.g., ZkTeco ProFace X) or use a firmware emulator (e.g., QEMU for ARM/MIPS).
  2. Connect the device to an isolated network.
  3. Identify the authentication endpoint (e.g., /cgi-bin/authenticate or /login).

Exploitation Steps:

  1. Send a POST request to the authentication endpoint with injected SQL:
    curl -X POST http://<device_ip>/login \
      -d "username=admin' OR '1'='1&password=' OR '1'='1"
    
  2. If successful, the device returns a session token or redirects to the admin panel.
  3. Use the session to access device settings, user lists, or door control.

Manual SQL Injection Payloads:

  • admin' -- (comment out password check)
  • admin' OR 1=1--
  • ' UNION SELECT 1,'admin','admin'--

Automated Tools:

  • Use sqlmap with a request file:
    sqlmap -r request.txt --batch --tables
    

Blue Team (Defensive)

Detection:

  • Monitor for unusual SQL characters in authentication requests (e.g., ', --, OR, UNION).
  • Enable logging on the device (if available) and review authentication logs for anomalies.
  • Use network intrusion detection systems (NIDS) to flag SQL injection patterns.

Mitigation:

  • Isolate vulnerable devices on a separate VLAN with strict firewall rules.
  • Implement a Web Application Firewall (WAF) in front of the device’s web interface.
  • If possible, disable the web interface and use only local (physical) authentication.

Indicators of Compromise (IOCs)

  • Network IOCs:

    • HTTP POST requests to /login or /cgi-bin/authenticate containing SQL keywords (OR, UNION, --, ').
    • Unusual session tokens or cookies after authentication.
    • Multiple failed login attempts followed by a successful login with a common username (e.g., admin).
  • Host IOCs:

    • Unexpected user accounts created or modified in the device database.
    • Changes to access control lists or door schedules.
    • Log entries showing authentication from unusual IP addresses.
  • File IOCs:

    • Modified configuration files (e.g., users.db, config.xml).
    • Presence of SQL injection payloads in web server logs.

Detection Engineering

YARA Rule

rule CVE_2023_3938_SQL_Injection {
    meta:
        description = "Detects SQL injection attempts targeting ZkTeco devices"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2023-3938"
    strings:
        $sqli1 = /(\%27|')\s*(OR|or)\s*(\%31|1)\s*(\%3D|=)/ nocase
        $sqli2 = /(\%27|')\s*(OR|or)\s*(\%27|')\s*(\%3D|=)/ nocase
        $sqli3 = /UNION\s+SELECT/i
        $sqli4 = /--\s*$/m
    condition:
        any of ($sqli*)
}

Sigma Rule

title: CVE-2023-3938 SQL Injection Attempt on ZkTeco Devices
id: 8a9b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects SQL injection patterns in HTTP requests to ZkTeco device authentication endpoints
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
detection:
    selection:
        cs-method: 'POST'
        cs-uri-query|contains:
            - '/login'
            - '/cgi-bin/authenticate'
        cs-uri-query|re:
            - ".*'.*OR.*1.*=.*"
            - ".*'.*OR.*'.*=.*"
            - ".*UNION.*SELECT.*"
            - ".*--.*"
    condition: selection
falsepositives:
    - Legitimate use of special characters in passwords (unlikely)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (
    msg:"CVE-2023-3938 SQL Injection Attempt on ZkTeco Device";
    flow:to_server,established;
    content:"POST"; http_method;
    content:"/login"; http_uri;
    pcre:"/(\%27|')\s*(OR|or)\s*(\%31|1)\s*(\%3D|=)/i";
    pcre:"/UNION\s+SELECT/i";
    sid:1000001;
    rev:1;
    reference:cve,2023-3938;
    priority:2;
)

Remediation & Mitigation

Immediate Actions:

  1. Isolate Devices: Place all affected ZkTeco devices on a separate VLAN with strict access controls. Do not expose the web interface to the internet.
  2. Disable Web Interface: If possible, disable the web-based management interface and use only local (physical) configuration methods.
  3. Monitor Logs: Enable and review authentication logs for signs of exploitation.

Long-Term Fix:

  • Vendor Patch: Contact ZkTeco or the OEM for a firmware update. Since no patch is available, consider replacing the devices with alternatives that have proper input validation.
  • WAF Deployment: Deploy a Web Application Firewall (e.g., ModSecurity) in front of the device to filter SQL injection attempts.
  • Network Segmentation: Implement network segmentation to limit access to the devices to only authorized administrative hosts.

Workarounds:

  • Input Validation: If the device allows custom scripts, implement server-side input validation to reject special characters.
  • Rate Limiting: Apply rate limiting on the authentication endpoint to slow down brute-force and injection attempts.

Valters IT

👁️ 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

💣 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-3938/ · 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.