Skip to content
Memory corruption Advisory Advanced CVE-2020-10005

Apple macOS SMB server TREE_CONNECT stack buffer overflow vulnerability

A stack buffer overflow in the macOS SMB server's handling of TREE_CONNECT requests allows a remote attacker to overwrite stack memory with a long share path, potentially leading to arbitrary code execution or denial of service.

Aleksandar Nikolic Follow

Originally disclosed on Cisco Talos

High 8.5 View original

A remote code execution vulnerability exists in the SMB Server Apple macOS 10.15.7. A specially crafted SMB packet can trigger a stack-based buffer overflow, which can lead to arbitrary code execution and denial of service.

Aleksandar Nikolic, 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 TREE_CONNECT handler copies a user-supplied path into a fixed-size stack buffer without checking its length.

Impact

A remote attacker could cause a denial of service or potentially execute arbitrary code on the affected system.

What the attacker needed

Network access to SMB service; valid SMB session (authenticated)

The fix

The vulnerability was fixed by the vendor in a patch released on 2021-05-25.

How it was found

  1. Set a breakpoint at smb2_dispatch_tree_connect to observe the TREE_CONNECT buffer.
  2. Send a crafted TREE_CONNECT request with an overly long share path.
  3. Continue execution to the memcpy call and observe the parameters.
  4. Step over the memcpy and observe a crash due to overwritten stack memory.

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.

The SMB server on macOS has a fixed-size memory area on the stack for storing the share path from a network request. If an attacker sends a path longer than that area, it spills over and corrupts other memory, which can crash the server or let the 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 Aleksandar Nikolic

View all

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