TCL LinkHub Mesh Wi-Fi confsrv addTimeGroup stack-based buffer overflow vulnerability
The confsrv service on the TCL LinkHub Mesh Wi-Fi router copies the 'week' field of a TimeRule protobuf message into a fixed-size stack buffer using strcpy without checking length. An attacker on the same Wi-Fi network can send a crafted packet to port 9003 and overflow the stack, which the crash shows can overwrite the saved return address and program counter.
A stack-based buffer overflow vulnerability exists in the confsrv addTimeGroup functionality of TCL LinkHub Mesh Wi-Fi MS1G0001.0014. A specially-crafted network packet can lead to a buffer overflow.
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 addTimeGroup function uses strcpy to copy the attacker-controlled 'week' string into a fixed 0x80-byte stack buffer without any length validation.
Impact
An attacker on the adjacent Wi-Fi network could crash the device and, as the crash shows control of the program counter, potentially execute arbitrary code with high confidentiality, integrity and availability impact.
What the attacker needed
Attacker on the device's Wi-Fi network; ability to send packets to port 9003
How it was found
- Connect to the Wi-Fi network provided by the LinkHub Mesh device.
- Send a protobuffer message to port 9003 containing a TimeGroup with at least one TimeRule.
- Populate the week field of the TimeRule with an oversized string.
- The ucloud binary routes the message to confsrv, which calls set_time_group_rule and then addTimeGroup.
- addTimeGroup copies the week value into a stack buffer with strcpy, overflowing it and overwriting the saved return address.
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.
A buffer overflow happens when a program copies more data into a fixed-size memory space than it can hold, so the extra data spills over into nearby memory. Here the router's software takes a text field from a network message and copies it into a small stack area without checking its size, so a long value overwrites the memory that records where the program should return. An attacker on the same Wi-Fi network could use this to crash the router or potentially run their own code on it.
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.