Skip to content
Info disclosure Write-up Advanced

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.

Muirey03 Follow

Published on muirey03.blogspot.com

September 19, 2020

Muirey03 (@Muirey03), on muirey03.blogspot.com

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

  1. Send several mach messages containing out-of-line port arrays sized to match the histogram buffer.
  2. Receive those messages to free the kernel buffers holding the port arrays.
  3. Open a connection to the IOSurfaceAcceleratorClient user client, causing the histogram buffer to be allocated over a freed port array.
  4. 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.

More from Apple

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.