cbcvebase.
CVE-2019-8641
published 2019-12-18

CVE-2019-8641: An out-of-bounds read was addressed with improved input validation.

PriorityP265critical9.8CVSS 3.1
AVNACLPRNUINSUCHIHAH
EXPLOIT
EPSS
17.00%
96.7th percentile
An out-of-bounds read was addressed with improved input validation.

Affected

13 ranges
VendorProductVersion rangeFixed in
appleios
appleios
appleios>= unspecified < iOS 12.4.2iOS 12.4.2
appleios>= unspecified < iOS 13iOS 13
appleiphone_os< 12.412.4
applemac_os_x< 10.14.610.14.6
applemacos>= unspecified < macOS Mojave 10.14.6 Supplemental Update 2macOS Mojave 10.14.6 Supplemental Update 2
applemacos_mojave_10.14.6_supplemental_update_2_security_update_2019-005_high_sierra
appletvos< 12.412.4
applewatchos< 5.35.3
applewatchos
applewatchos>= unspecified < watchOS 6watchOS 6
applewatchos>= unspecified < watchOS 5.3.2watchOS 5.3.2

Detection & IOCsextracted from sources · hover to see the quote

urlhttps://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/47608.zip
urlhttps://gitlab.com/exploit-database/exploitdb-bin-sploits/-/raw/main/bin-sploits/47415.zip
commandclang -o tester tester.m -framework Foundation
commandclang decodeshared.m -o decodeshared -fobjc-arc -framework Corespotlight
commandDYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib ./decodeshared obj
process-[NSSharedKeySet indexForKey:]
filenamepayload.xml
  • Monitor for deserialization of NSSharedKeyDictionary and NSSharedKeySet via NSUnarchiver/NSKeyedUnarchiver in iMessage processing; a crafted payload exploiting this bug will trigger an out-of-bounds read crash in -[NSSharedKeySet indexForKey:] within CoreFoundation.
  • Crash signature to look for: EXC_BAD_ACCESS (code=1) at address 0x414141410 inside CoreFoundation -[NSSharedKeySet indexForKey:] + 566, indicating attacker-controlled heap spray address dereference.
  • Detect iMessage-delivered payloads that encode NSSharedKeyDictionary objects with a circular _subKeySet reference (SharedKeySet1 -> SharedKeySet2 -> SharedKeySet1); this self-referential structure is the exploit primitive.
  • Flag NSSharedKeySet objects decoded with _numKeys set to 0xffffffff (UINT_MAX) while _keys is still null/uninitialized — this is the precondition for the out-of-bounds read primitive.
  • Alert on Springboard crashes involving out-of-bounds reads in Foundation/CoreFoundation triggered by incoming iMessage data, particularly involving NSSharedKeyDictionary value array accesses beyond allocated heap memory.
  • ·The exploit requires NSSharedKeyDictionary to be an allowed deserialization class via NSUnarchiver; if the attack surface is removed (e.g., by disallowing NSSharedKeyDictionary in the unarchiver allowlist), the vulnerability is not reachable.
  • ·The PoC does not crash reliably in Springboard; exploitability in production iMessage environments may require additional heap spray primitives to achieve reliable code execution.
  • ·Combined with a heap spray, the bug could be remotely exploitable; detection should account for heap spray activity alongside the deserialization crash.
  • ·NSSharedKeyDictionary instances can be correctly encoded and decoded with the standard NSDictionary initWithCoder, meaning legitimate traffic will not use the NSSharedKeyDictionary-specific encoding path; any such encoded object in iMessage is anomalous.

CVSS provenance

nvdv3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
nvdv2.07.5HIGHAV:N/AC:L/Au:N/C:P/I:P/A:P
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.