Apple DCERPC array marshaling uninitialized memory disclosure vulnerability
The DCERPC array marshaling code on macOS can use uninitialized memory when preparing a reply for an out-only open array, potentially disclosing fragments of previously used memory. An authenticated remote attacker can trigger this via a crafted RPC request to the mdssvc service, or a local attacker via a local socket.
Originally disclosed on Cisco Talos
There exists a vulnerability in the array marshaling code of DCERPC library as used in Apple macOS 12.6.1 that can lead to use of uninitialized memory. A specially-crafted network packet can cause parts of uninitialized memory to be disclosed.
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, an out-only open array is allocated during unmarshalling but not initialised before marshalling, and a strlen call on the uninitialised buffer determines the length of data to include in the reply.
Impact
An attacker could potentially disclose fragments of previously used memory, including other requests and replies as well as memory pointers, though with an idle service uninitialized memory often contains zeroes and no ill effect is achieved.
What the attacker needed
Authenticated remote attacker; or local attacker with socket access; target service mdssvc running
The fix
It was fixed by Apple on 2023-03-27.
How it was found
- Send a valid mdssvc_open RPC request with a non-existent target share to the mdssvc endpoint, either directly or over SMB.
- The service allocates an out-only array during unmarshalling but does not initialise it.
- During marshalling of the reply, strlen is called on the uninitialised array, and its contents may be included in the response.
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.
When a program allocates memory for a reply, it should fill it with data before sending it. Here, the program sometimes sends back memory that was never filled in, which can contain leftover data from earlier operations. An attacker who can send requests to the service might receive that leftover data in the response.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.