Skip to content
Memory corruption Advisory Advanced CVE-2018-4023

Novatek NT9665X XML_UploadFile path overflow code execution vulnerability

The XML_UploadFile Wi-Fi command in the NT9665X firmware copies the HTTP URL path into a fixed-size stack buffer without checking length, so a long path overflows the buffer and overwrites the return address. An attacker on the camera's Wi-Fi network can send a crafted request to execute arbitrary code on the device.

Lilith >_> Follow

Originally disclosed on Cisco Talos

Critical 10.0 View original

An exploitable code execution vulnerability exists in the XMLUploadFile Wi-Fi command of the NT9665X Chipset firmware, running on the Anker Roav A1 Dashcam, version “RoavA1SWV1.9”. A specially crafted packet can cause a stack-based buffer overflow, resulting in code execution.

Lilith [<_<], on Cisco Talos

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 fixup_path function copies the URL path into a 0x80-byte stack buffer without any bounds checking, stopping only at a null byte.

Impact

An attacker on the camera's Wi-Fi network could execute arbitrary code on the device, leading to full compromise.

What the attacker needed

Wi-Fi AP enabled on the dashcam; Attacker connected to the camera's Wi-Fi network; Default Wi-Fi password (goroavcam) or knowledge of it

The fix

The vendor fixed the issue and provided a patch to their IDH.

How it was found

  1. Enable the Wi-Fi AP setting on the dashcam and connect to its SSID using the default password.
  2. Send an HTTP request to the camera's web server on port 80 with the XML_UploadFile command (cmd=5001) and a URL path longer than the 0x80-byte stack buffer.
  3. The fixup_path function copies the path into the stack buffer without bounds checking, overflowing it and overwriting the return address.
  4. The camera crashes with a CPU exception, and the attacker can control the return address to execute code.

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 stack buffer overflow happens when a program copies more data into a small, fixed-size memory area than it can hold, so the extra data spills over and can overwrite important control information. Here, the camera's web server takes the path part of a web request and copies it into a small buffer without checking its length. By sending a very long path, an attacker can overwrite the return address and redirect the camera's execution to 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.

More by Lilith >_>

View all

5 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.