Skip to content
RCE Write-up Advanced

Multiple remote code execution vulnerabilities in danfoss sm-800A

The Danfoss AK-SM800A refrigeration controller firmware contains multiple pre-authentication stack-based buffer overflows in its web interface, caused by unsafe use of strcpy on user-supplied input. An unauthenticated attacker could exploit these to achieve remote code execution as root, potentially taking over the device, persisting across reboots, or bricking it.

midnightblue.nl

Published on midnightblue.nl

Since October 11th waves of cyber attacks have hit internet-exposed fridge controllers by Danfoss and Copeland throughout Europe, with attackers triggering defrosting operations and causing tens of millions of euros in spoilt food damages and even causing fires in some cases.

The author, on midnightblue.nl

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

Root cause

Likely the use of strcpy() without bounds checking on user-controlled input in unauthenticated CGI handlers, combined with missing stack canaries and PIE, allows stack-based buffer overflows.

Impact

An unauthenticated attacker could achieve full device takeover, persist across factory resets, or brick the controller, potentially disrupting refrigeration and causing food spoilage or equipment damage.

What the attacker needed

Network access to the controller's web interface; no authentication required

The fix

The vulnerabilities are to be fixed in the upcoming 5.5.x firmware release, but the author recommends removing internet exposure as the primary mitigation.

How it was found

  1. Download the firmware image and set up userland emulation with qemu-armel-static.
  2. Use LD_PRELOAD to hijack execution and start the web server component.
  3. Send a crafted HTTP POST request with an overly long parameter to an unauthenticated CGI endpoint.
  4. Observe a segmentation fault indicating control-flow hijack potential.
  5. Develop an exploit to achieve remote code execution as root.

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.

A buffer overflow happens when a program copies more data into a fixed-size memory space than it can hold, overwriting nearby memory. Here, the controller's web server uses an unsafe function to copy user input without checking length, so an attacker can send a long request that crashes the program and potentially lets them run their own code. Because the vulnerable program runs with the highest privileges (root), a successful attack gives full control of the device.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.