Skip to content
DoS Advisory Advanced

Apple DCERPC zero length BIND packet infinite loop

The DCERPC library on macOS trusts the fragment length field in an incoming packet and uses it to set the size of the fragment buffer, so a packet with a zero fragment length causes no bytes to be consumed and the receive loop runs forever. An authenticated remote attacker, or a local attacker writing to a local socket, could exhaust resources and cause a denial of service, with a possible crash or memory corruption.

Aleksandar Nikolic Follow

Originally disclosed on Cisco Talos

Medium 5.3 View original

An infinite loop vulnerability exists in the way DCERPC library as used in Apple macOS 12.6.1 deals with fragment sizes. A specially-crafted network packet can cause an infinite loop, which can result in unconstrained resource utilization 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 fragment length field from the packet is used unchecked to set the fragment buffer's data size, so a zero value means no input is consumed and the receive loop never advances.

Impact

The server could loop indefinitely, exhausting resources and causing denial of service, and because the service is multithreaded and timing is attacker-controlled this could lead to an immediate crash on a NULL pointer dereference or further memory corruption.

What the attacker needed

Authenticated remote access or local socket access; ability to keep the connection open

The fix

It was fixed by Apple on 2023-03-27.

How it was found

  1. Send a first, properly formed BIND packet with the expected fragment length to set the state machine.
  2. Send a second, truncated BIND packet whose fragment length is set to zero.
  3. Keep the connection open so the server loops, allocates memory and sends failure packets.

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.

DCERPC is a protocol used for remote procedure calls, where one program asks another to run a function over the network. Each packet carries a number saying how long it is, and the server uses that number to decide how much data it has read. If the number is zero, the server keeps reading the same data over and over without ever moving forward, which ties up the machine and can make it crash or become unusable.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

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.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.