Skip to content
Info disclosure Write-up Intermediate

XProtectRemediatorDubRobber infoleak on macOS (CVE-2024-40842)

A privileged macOS binary that has Full Disk Access relies on libmagic, which honours an environment variable pointing to its database. An attacker who can run the binary can point it to a malicious database, and libmagic's error messages then leak the contents of files it fails to parse, including full text files.

Gergely Kalman Follow

Published on gergelykalman.com

JBO reached out to me, and as it turns out we have collided on the bug I was about to publish, so I won't be doing that until this is cleared up.

Gergely Kalman, on gergelykalman.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 privileged binary used libmagic, which reads the MAGIC environment variable to locate its database, so an attacker could supply a malicious database and trigger error messages that leak file contents.

Impact

An attacker could leak the contents of arbitrary text files protected by TCC, but binary files such as sqlite databases, binary plists and images were not leaked fully.

What the attacker needed

Ability to run the privileged binary; attacker-controlled MAGIC database file

The fix

Apple fixed the bug by removing the MAGIC environment variable when the binary is invoked, and likely by making libmagic ignore MAGIC in privileged processes.

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.

Some programs on macOS have special permission to read every file on the computer, called Full Disk Access. This report shows that one such program used a file-inspection library that could be tricked into reading a different database file, and when that database was broken the library printed the file's contents in an error message. That let an attacker read protected text files, though not binary files.

What is Info disclosure?

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

More by Gergely Kalman

View all

7 more disclosed reports, best first.

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.