Skip to content
Memory corruption Advisory Advanced CVE-2024-21778

Realtek rtl819x Jungle SDK configuration file mib_init_value_array heap-based buffer overflow vulnerability

A configuration upload endpoint on the router parses TLV data from an uploaded file and copies a length taken from the file into a fixed-size heap buffer without checking it. An attacker who can upload a crafted configuration file could overflow the heap and potentially execute arbitrary code.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

High 7.2 View original

A heap-based buffer overflow vulnerability exists in the configuration file mibinitvaluearray functionality of Realtek rtl819x Jungle SDK v3.4.11. A specially crafted .dat file can lead to arbitrary code execution.

Francesco Benvenuto and Kelly Patterson, 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 length field from the uploaded TLV data is used in a memcpy into a fixed-size heap buffer without any bounds check.

Impact

A crafted configuration file could overflow the heap and lead to arbitrary code execution, though the attacker needs high privileges to reach the upload function.

What the attacker needed

Administrator access to the router; ability to upload a config file

The fix

The length taken from the TLV data should be validated against the destination buffer size before the copy; Realtek released updated software to its customers, while LevelOne declined to patch.

How it was found

  1. Upload a crafted configuration file through the formUploadConfig endpoint.
  2. The file's TLV length field exceeds the fixed buffer size of 0x924d.
  3. The parser copies the oversized value into the heap buffer, overflowing it.

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.

The router lets an administrator upload a settings file. That file is a list of items, each with a length field, and the router trusts the length when copying the item into a fixed-size area of memory. If the length is bigger than the area, the copy spills over into neighbouring memory, which can crash the router or let an attacker run 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 Francesco Benvenuto

View all

1 more disclosed report, 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.