Skip to content
Race condition Write-up Advanced

(CVE-2021-30868) macOS smbfs Race Condition leading to Use-After-Free Vulnerability

A race condition in the macOS smbfs kernel extension leads to a use-after-free, allowing an attacker with user privileges to escalate to root. The text states the vulnerability occurs in smbfs and permits privilege escalation.

starlabs.sg

Published on starlabs.sg

smbfs is a kext driver which handles SMB connection between the user and SMB Server. This vulnerability occurs in smbfs, which allows attacker can escalate from user permission into root privilege.

The author, on starlabs.sg

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 race condition in the smbfs kernel extension that results in a use-after-free, though the text does not explain the exact code path.

Impact

An attacker with user permission could escalate to root privilege.

What the attacker needed

Local user access on macOS; smbfs kext loaded

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 extension is a piece of code that runs with the highest level of trust in the operating system. A race condition means two actions happen at the same time in an unsafe order, and a use-after-free means the program keeps using memory after it has been freed. Here, a flaw in the macOS SMB file-sharing driver lets a normal user gain full control of the machine.

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.