Skip to content
Memory corruption Write-up Advanced

IOMFBintegeroverflowpoc

An integer overflow in the size calculation for a kernel buffer in IOMFB allowed a sandboxed app to trigger a kernel panic. The attacker could cause memory corruption by supplying crafted values to an external method, leading to a wildcopy and a crash.

saaramar.github.io

Published on saaramar.github.io

In the last iOS security update (15.0.2) Apple fixed a vulnerability in IOMobileFrameBuffer/AppleCLCD, which they specified was exploited in the wild (CVE-2021-30883). This attack surface is highly interesting because it’s accessible from the app sandbox (so it’s great for jailbreaks) and many other processes, making…

The author, on saaramar.github.io

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

Likely a 32-bit integer overflow in the size calculation for a kernel allocation, with no overflow checks, leading to a buffer that is too small and subsequent out-of-bounds writes.

Impact

A sandboxed app could trigger a kernel panic and potentially achieve memory corruption, though the report only demonstrates a denial-of-service crash.

What the attacker needed

Ability to run a crafted app on the device

The fix

The patch promoted the arithmetic to 64-bit, added upper limit checks, and included a NULL check.

How it was found

  1. Open the AppleCLCD service and obtain a user client connection.
  2. Prepare an input buffer with the first 32-bit value set to 3 and the rest filled with a controlled pattern.
  3. Call external method 78 with two scalar arguments set to zero and the crafted input buffer.
  4. Observe a kernel panic due to memory corruption.

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.

A kernel driver calculates how much memory to allocate using numbers supplied by an app. Because the calculation can overflow, the allocated buffer is too small, and the driver then writes past its end, corrupting memory and crashing the device.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.