Skip to content
Memory corruption Write-up Advanced

Exploitation of Philips Smart TV

The Philips Smart TV runs a vulnerable version of libupnp with a stack overflow in the unique_service_name function. An attacker on the local network can send a crafted UPnP packet to crash the service, and by overwriting saved registers and placing code in an executable heap, achieve remote code execution as root.

fredericb.info

Published on fredericb.info

My Philips Smart TV is a Linux box standing there in my living room : that's a sufficient reason to try to get root.

Frédéric, on fredericb.info

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 write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker on the local network could execute arbitrary code as root on the TV, leading to full compromise and the ability to decrypt firmware updates.

What the attacker needed

Attacker on the same local network; target runs vulnerable libupnp 1.4; no authentication needed

How it was found

  1. Send a UDP NOTIFY packet to the UPnP multicast address with an oversized USN field to trigger the crash.
  2. Observe the crash on the serial console to confirm the vulnerable libupnp version and lack of stack protection.
  3. Cross-compile the same libupnp version and disassemble the vulnerable function to understand register usage.
  4. Use the crash behaviour to map memory regions and identify an executable heap.
  5. Send a custom UPnP packet to place arbitrary code in the heap.
  6. Use the overflow to set a register to point to a known substring in the heap, then brute-force the address by monitoring responses, and finally redirect execution to the 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 write-up has not been written yet. The Original tab links to the source.

The TV has a network service that listens for UPnP messages. A bug in the library that handles these messages lets an attacker send a specially crafted message that overwrites part of the program's memory. Because the memory is executable and not randomised, the attacker can run their own code on the TV, with full control.

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.

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.