Reolink RLC-410W netserver parse_command_list memory corruption vulnerability
The netserver component of the Reolink RLC-410W camera fails to properly validate the XML length field in API requests, allowing an attacker to write a null byte to a partially controlled heap address. This out-of-bounds write could lead to memory corruption and potentially remote code execution.
Originally disclosed on Cisco Talos
A memory corruption vulnerability exists in the netserver parsecommandlist functionality of reolink RLC-410W v3.0.0.13620121102. A specially-crafted HTTP request can lead to an out-of-bounds write.
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
The XML length field from the request is only checked to be non-negative, not against the actual buffer size, leading to an out-of-bounds write.
Impact
An attacker could write a null byte to a partially controlled heap address, potentially leading to memory corruption and remote code execution.
What the attacker needed
Network access to the camera's netserver
The fix
The vulnerability was fixed by the vendor.
How it was found
- Send an HTTP request to the netserver with a valid header and a positive XML length value.
- The header is processed by version_detect, which sets parse_state to 2 and header_len to 0x18.
- The body is received and parse_recved_data creates a command node with the provided data.
- The command is added to the list and later parsed by parse_command_list.
- In parse_command_list, the XML length is used to calculate an address, and a null byte is written there.
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.
This report describes a flaw in a security camera's network service. The service trusts a number in the request that says how long the XML data is, without checking if that number is too large. An attacker can send a request with a huge number, causing the program to write a zero byte far outside the intended memory area, which can crash the camera or let the attacker 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.