Hangzhou Hikvision Digital Technology Co., Ltd. Face Recognition Modules SADP XML parsing stack-based buffer overflow vulnerability
The SADP XML parser in Hikvision face recognition terminal firmware copies tag names into fixed 0x80-byte stack buffers without bounding the length. An attacker sending a crafted SADP packet over the local network could overflow the stack and potentially execute code remotely.
A stack-based buffer overflow vulnerability exists in the SADP XML parsing functionality of Hangzhou Hikvision Digital Technology Co., Ltd. Ultra Face Recognition Terminal 3.7.60250613 and Face Recognition Terminal for Turnstyle 3.7.0240524 (under emulation).
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the parser increments tag length counters without an upper bound and then uses those lengths in strncpy calls into fixed 0x80-byte stack buffers.
Impact
An attacker on the adjacent network could achieve remote code execution with high confidentiality, integrity and availability impact, though the payload is limited to 0x800 bytes and may contain only one null byte at the end.
What the attacker needed
Network access to UDP port 37020; payload of at most 0x800 bytes; single null byte only at the end
The fix
The vendor released a patch on 2026-01-12.
How it was found
- Send a SADP packet to the device's multicast address on UDP port 37020.
- The packet is received into a buffer of at most 0x800 bytes and passed to the XML parser.
- The parser counts the length of the start or close tag name.
- During finalisation the name is copied into a 0x80-byte stack buffer using the unbounded length.
- A long enough tag name overflows the stack frame and can control the program counter.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
These access-control terminals listen on the local network for a discovery protocol that carries XML text. The code that reads tag names from that text copies them into a small fixed-size space on the stack without checking how long they are, so a long name spills over into neighbouring memory. That spill can let an attacker redirect the program and run their own code.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.