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

Mitsubishi Electric Corporation MELSEC iQ-F FX5U MELSOFT Direct memory corruption vulnerability

A stack-based buffer overflow exists in the MELSOFT Direct protocol of the Mitsubishi Electric MELSEC iQ-F FX5U PLC. An attacker can send a specially crafted UDP packet to overflow a stack buffer, causing denial of service and potentially remote code execution.

Matt Wiseman Follow

Originally disclosed on Cisco Talos

Critical 10.0 View original

A memory corruption vulnerability exists in the MELSOFT Direct functionality of Mitsubishi Electric Corporation MELSEC iQ-F FX5U v1.240 and v1.260. A specially crafted network packet can lead to a buffer overflow.

Matt Wiseman, 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 vulnerable function copies an attacker-controlled filepath into a fixed-size stack buffer using an attacker-controlled length, without validating that the length fits the buffer.

Impact

The overflow can cause a denial of service in the RTOS task handling MELSOFT Direct and potentially allow remote code execution.

What the attacker needed

Network access to UDP port 5560

The fix

The vendor released a patch; the underlying fix should validate the filepath length before copying it into the fixed-size stack buffer.

How it was found

  1. Send a MELSOFT Direct packet to UDP port 5560 with feature set 0xC and sub-feature 0x10 or 0x11.
  2. Include a filepath and filepath_length in the packet body that exceed the size of the local filename buffer.
  3. The device copies the oversized filepath into the stack buffer, causing a 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.

This is a memory corruption bug in an industrial controller. The device copies data from a network packet into a fixed-size space on its stack without checking the length, so a long packet can overwrite nearby memory. This can crash the device or, in the worst case, 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 Matt Wiseman

View all

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