
Proof-of-concept for CVE-2026-105810, an authenticated stack buffer overflow in TP-Link Tapo C320WS connectAp that achieves root RCE via a ROP chain.
connectAp stack overflow (RCE as root)Authenticated stack-based buffer overflow in the Wi-Fi onboarding path of the
TP-Link Tapo C320WS camera. An authenticated client on the adjacent network can
overflow a fixed stack buffer during base64 decoding of the encrypted Wi-Fi
password and redirect execution into a ROP chain that calls system() as root.
| CVE | CVE-2026-105810 |
| Advisory | TP-Link Security Advisory (faq/5351) |
| Product | TP-Link Tapo C320WS, hardware V2.0 |
| Affected firmware | ≤ 1.5.3 Build 260304 |
| Fixed firmware | 1.6.6 Build 260917 Rel.81089n |
| Class | CWE-121 stack-based buffer overflow |
| CVSS v4.0 | 8.5 (High) AV:A/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| Impact | remote command execution as root |
The onboarding.connect (connectAp) handler base64-decodes the
attacker-supplied encrypted Wi-Fi password into a fixed 1024-byte stack
buffer. The shared decode wrapper passes mbedTLS a destination capacity
computed from the encoded input length (4*((len+2)/3)+1) rather than the
true buffer size, so the library's bounds check can never fail against the
attacker. The decode routine has no stack canary and returns through
POP {R4-R11,PC}; a long enough password overwrites the saved return address.
Because the binary is a non-PIE ARM executable, a stable ROP chain reaches
system() with an attacker-controlled command, executing as root.
poc.py authenticates to the local API, builds the ROP payload, and
sends the connectAp overflow. By default it runs a benign marker command
(id written to /tmp/CVE-2026-105810.poc on the device) to demonstrate code
execution without acting as a hands-free attack tool.
python3 poc.py --host 192.168.0.10 --username admin --password 'YourCameraPassword'
Inspect the payload without sending anything:
python3 poc.py --host x --password x --command 'id' --print-payload
The overflow is blind: the camera executes the command but returns nothing
over the API. Verify out of band — e.g. read the marker file from a shell on the
device, or point --command at a benign action with an observable effect you
control on your own network. The gadget offsets in poc.py are specific to
firmware 1.5.3 Build 260304; adjust FW_1_5_3_260304 for another build.
This material is published after coordinated disclosure and a vendor fix.
It is for defenders, researchers, and owners validating their own devices. Use
it only against hardware you own or are explicitly authorised to test, and
patch to 1.6.6 Build 260917 or later.
MIT.