vendor:
Mac OS X
by:
ianbeer
7,8
CVSS
HIGH
Unsafe OSArray manipulation
362
CWE
Product Name: Mac OS X
Affected Version From: OS X 10.11 ElCapitan (15A284)
Affected Version To: OS X 10.11 ElCapitan (15A284)
Patch Exists: NO
Related CWE: N/A
CPE: o:apple:mac_os_x:10.11.6
Metasploit:
N/A
Other Scripts:
N/A
Tags: N/A
CVSS Metrics: N/A
Nuclei References:
N/A
Nuclei Metadata: N/A
Platforms Tested: OS X 10.11 ElCapitan (15A284)
2015
Spoofed no-more-senders notifications with IOBluetoothHCIPacketLogUserClient leads to unsafe parallel OSArray manipulation
The OS* data types (OSArray etc) are explicity not thread safe; they rely on their callers to implement the required locking to serialize all accesses and manipulations of them. By sending two spoofed no-more-senders notifications on two threads at the same time we can cause parallel calls to OSArray::removeObject with no locks which is unsafe. In this particular case you might see two threads both passing the index >= count check in OSArray::removeObject (when count = 1 and index = 0) but then both decrementing count leading to an OSArray with a count of 0xffffffff leading to memory corruption when trying to shift the array contents.
Mitigation:
Implement the required locking to serialize all accesses and manipulations of the OS* data types.