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

Weston Embedded uC-HTTP HTTP Server out-of-bounds write vulnerability

An out-of-bounds write occurs when parsing the HTTP method if the method string is prepended with bytes outside the printable ASCII range, causing a mismatch between the receive buffer pointer and remaining length. An attacker could send a crafted network packet to corrupt heap memory and potentially control the address of the next heap allocation.

Kelly Leuschner Follow

Originally disclosed on Cisco Talos

High 7.7 View original

An out-of-bounds write vulnerability exists in the HTTP Server functionality of Weston Embedded uC-HTTP v3.01.01. A specially crafted network packet can lead to memory corruption.

Kelly Leuschner, 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

Likely the method parsing code advances the buffer pointer past skipped non-printable bytes but then recalculates the remaining length without accounting for those skipped bytes, so the pointer and length become mismatched and later used as an out-of-bounds index.

Impact

An attacker could corrupt heap memory and potentially control the address of the next heap allocation, leading to memory corruption and possibly a crash.

What the attacker needed

Network access to the HTTP server; send a crafted HTTP request

The fix

The vendor released a patch; the code should be fixed so that the remaining length accounts for skipped bytes.

How it was found

  1. Send an HTTP request whose method string is prepended with bytes less than 0x21 or greater than 0x7e.
  2. Include form data in the request body.
  3. The server parses the form data using the incorrect remaining length, causing an out-of-bounds write when null-terminating a value.

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 is a memory corruption bug in a web server used on small embedded devices. When the server reads the start of an HTTP request, it can be tricked by unusual characters into writing data past the end of a buffer, which can crash the server or let an attacker influence memory. An attacker only needs to send a specially crafted network request.

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 Kelly Leuschner

View all

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