CVE-2020-9964 - An iOS infoleak
An iOS kernel driver allocated a buffer for histogram data without zeroing it, then returned that uninitialised memory to userspace. A local attacker could read kernel memory, potentially leaking mach port addresses or defeating kernel address space layout randomisation.
September 19, 2020
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The driver allocated a buffer with IOMalloc, which does not zero memory, and never initialised it before copying its contents back to userspace.
Impact
A local user could read kernel memory, which could leak mach port addresses or help defeat kASLR; the author notes iOS 14 heap separation may have affected exploitability.
What the attacker needed
Local code execution on iOS; app sandbox access
The fix
The buffer should be zeroed or otherwise initialised before being returned to userspace.
How it was found
- Send several mach messages containing out-of-line port arrays sized to match the histogram buffer.
- Receive those messages to free the kernel buffers holding the port arrays.
- Open a connection to the IOSurfaceAcceleratorClient user client, causing the histogram buffer to be allocated over a freed port array.
- Call external method 9 with a userspace pointer to read the uninitialised buffer contents back.
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 write-up has not been written yet. The Original tab links to the source.
When a program asks the operating system for memory, it may get a block that was used before and still contains old data. If the program does not clear that block before handing it back to the user, the user can read whatever was left there. Here, a driver for image processing returned such a block, letting an app read leftover kernel data.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.