Skip to content
Access control Write-up Advanced

“Psychic Paper”

iOS uses several different plist parsers to read the entitlements embedded in an app's code signature, and they disagree on slightly malformed XML comments. An attacker could craft an entitlements file that amfid's parser sees as empty while the kernel and other parsers see privileged entitlements, escaping the app sandbox.

siguza.github.io

Published on siguza.github.io

Yesterday Apple released iOS 13.5 beta 3 (seemingly renaming iOS 13.4.5 to 13.5 there), and that killed one of my bugs. It wasn’t just any bug though, it was the first 0day I had ever found.

The author, on siguza.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 design flaw: multiple independent plist parsers disagree on malformed XML comment tokens, so the same entitlements blob is interpreted differently by the checker and the enforcer.

Impact

An attacker could give a third-party app entitlements such as no-container and task_for_pid-allow, escaping the sandbox and reaching user data and many services; the text notes some install tools may not preserve the crafted entitlements.

What the attacker needed

A developer certificate and provisioning profile; ability to sign and install an app; install method that preserves entitlements

The fix

The text does not describe a fix; it only notes that an iOS 13.5 beta killed the bug.

How it was found

  1. Build an app and sign it yourself with a developer certificate and provisioning profile
  2. Craft an entitlements plist using comment tokens that the parsers treat differently
  3. Install the app on the device
  4. The signature check sees no entitlements while the kernel sees the privileged ones

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.

An app on iOS carries a list of permissions called entitlements, stored as a small XML file. Different parts of the system read that file with different parsers, and the author found that a deliberately odd comment makes one parser see nothing while the others see extra permissions, so the app gets powers it was never granted.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.