Skip to content
Memory corruption Write-up Advanced

SAP DIAG Memory Corruption CVE-2026-34265: Pre-Auth Bug in the SAP GUI Protocol

The SAP DIAG protocol parser in the NetWeaver ABAP kernel did not validate length and count fields sent by a client before logon, allowing crafted DIAG messages to read or write memory outside the intended buffer. An unauthenticated attacker with network access to the dispatcher port could crash work processes, leak server memory, and potentially execute code.

RedRays Team Follow

Published on redrays.io

SAP Security on Udemy

RedRays Team, on redrays.io

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

The parser loaded client-supplied 16-bit counts as signed values and used the original unchecked value to compute buffer offsets, while only the loop bound was clamped, so negative or oversized values moved reads and writes outside the buffer.

Impact

An unauthenticated network attacker could at minimum crash work processes and leak server memory, and SAP's note lists remote code execution among the possible outcomes, though the author's lab only demonstrated crashes and leaks.

What the attacker needed

Network access to dispatcher port 32NN; no account or password needed

The fix

SAP released a kernel patch (Security Note 3714806) that adds the missing length checks, and the author advises installing the latest kernel patch level because a later note fixes a second related flaw; SAP states there is no workaround.

How it was found

  1. Open a TCP connection to the dispatcher port and send a DIAG connect packet as the first message.
  2. Include a connect item followed by an application item carrying an EPP passport blob.
  3. Set the sub-item length field so the destination capacity is taken from the attacker-controlled source length.
  4. Send a payload long enough to overwrite the saved return address on the stack.
  5. Observe the work process crash or memory leak in the trace and dev_w files.

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.

SAP GUI talks to the SAP server using a binary protocol called DIAG, and the server must read the first part of that conversation before the user has logged in. The server trusted numbers inside the message (how long a field is, how many items it holds) without checking them against the real data size, so a malicious message could make it write past the end of a memory buffer. Because this happens before login, anyone who can reach the network port could try it without any account.

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 RedRays Team

View all

10 more disclosed reports, best first.

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.