Skip to content
Memory corruption Write-up Advanced

CVE-2022-26937: Microsoft Windows Network File System NLM Portmap Stack Buffer Overflow

A stack buffer overflow exists in Windows Network File System because the NlmGetClientAddressAndConnection function does not verify the size of the Universal Address string returned in a GETADDR RPC reply. A remote attacker can send crafted RPC packets to trigger the overflow, potentially achieving code execution as SYSTEM.

Yuki Chen Follow

Published on zerodayinitiative.com

A stack buffer overflow vulnerability exists in Windows Network File System. The vulnerability is due to improper handling of crafted RPC responses to Portmap requests made by the Network Lock Manager (NLM) RPC program.

Yuki Chen (@guhe120), Guy Lederfein (@glederfein), Jason McFadyen, on zerodayinitiative.com

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

Successful exploitation may result in arbitrary code execution under the context of SYSTEM; unsuccessful exploitation results in a crash of the target system.

What the attacker needed

NFS server with NLM and RPCBIND enabled; IPv6 used for ONC RPC communication; Attacker can send and receive RPC packets

How it was found

  1. Send an NLM request that triggers an asynchronous response from the NFS server.
  2. When the server sends a GETADDR RPC request to the client, respond with a crafted GETADDR reply containing an oversized Universal Address string.
  3. The server processes the reply, causing the stack 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 write-up has not been written yet. The Original tab links to the source.

This is a memory corruption bug in a Windows file-sharing service. When the service asks a client for its network address, it copies the reply into a fixed-size box without checking how long the reply is. If the reply is too long, it spills over into nearby memory, which an attacker can use to run their own code with high privileges.

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 from Microsoft

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.