Skip to content
Memory corruption Advisory Advanced CVE-2023-24019

Milesight UR32L urvpn_client http_connection_readcb stack-based buffer overflow vulnerability

A stack-based buffer overflow exists in the urvpn_client's http_connection_readcb function of Milesight UR32L v32.3.0.5. An attacker can send a malicious packet to trigger the overflow, potentially leading to code execution.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

High 8.1 View original

A stack-based buffer overflow vulnerability exists in the urvpnclient httpconnectionreadcb functionality of Milesight UR32L v32.3.0.5. A specially crafted network packet can lead to a buffer overflow.

Francesco Benvenuto, 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 http_status_message stack buffer is only 52 bytes long, and the sscanf call that parses the HTTP status line does not limit the length of the status message, allowing a buffer overflow.

Impact

An attacker could exploit this to cause a buffer overflow, potentially leading to code execution with high confidentiality, integrity, and availability impact, though the attack requires the VPN service to be enabled and a man-in-the-middle position (possible due to a separate vulnerability).

What the attacker needed

Milesight VPN service enabled; Attacker can intercept or control VPN server response

How it was found

  1. Enable the Milesight VPN service on the router (disabled by default).
  2. The urvpn_client connects to the Milesight VPN server and sends an authentication request.
  3. The server responds with an HTTP response containing an overly long status message.
  4. The http_connection_readcb function reads the response line and parses it with sscanf, causing a stack buffer overflow.

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 writes more data into a fixed-size memory area than it can hold, causing adjacent memory to be overwritten. Here, the router's VPN client reads a response from a server and copies the status message into a small 52-byte buffer without checking the length, so an attacker who can control the server's response can overflow that buffer and potentially take over the device.

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 Francesco Benvenuto

View all

152 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.