Apple DCERPC association groups heap overflow
A heap overflow exists in Apple macOS DCERPC due to an integer overflow when expanding the association group table. An authenticated remote attacker could send a crafted network packet to trigger memory corruption, potentially leading to arbitrary code execution.
Originally disclosed on Cisco Talos
A heap overflow vulnerability exists in the way DCERPC library as used in Apple macOS 12.6.1 keeps track of association groups related to BIND requests. A specially-crafted network packet can cause an integer overflow, which can result in heap overflow, possibly leading to arbitrary code execution.
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
Likely a 16-bit unsigned integer overflow when adding a fixed allocation size to the current group count, leading to an undersized heap allocation followed by a memcpy using the original (non-overflowed) size.
Impact
A remote authenticated attacker could cause memory corruption and possibly arbitrary code execution; a local attacker could trigger it via a local socket.
What the attacker needed
Authenticated remote access or local socket access; ability to send crafted DCERPC packets
The fix
It was fixed by Apple on 2023-03-27.
How it was found
- Craft two BIND PDUs to trigger TALOS-2022-1679 and reach the vulnerable code path.
- Send the crafted packets to the DCERPC service, causing the association group table to expand.
- The integer overflow leads to a small allocation, and the subsequent memcpy overflows the heap buffer.
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 report describes a memory corruption bug in a part of macOS that handles a network protocol called DCERPC. When the system tries to make room for a new 'association group', a number used for the size wraps around to a small value, so too little memory is reserved and then a large copy overflows the buffer. An attacker who can send network packets could exploit this to crash the service or possibly 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.