Skip to content
Memory corruption Write-up Advanced

(CVE-2021-30845) macOS smbfs Out-of-Bounds Read

The smbfs kernel extension's mount handler reads beyond the bounds of a user-supplied buffer when processing a mount request. An attacker could use this to leak kernel memory, which the report says could aid further exploitation.

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 an attacker to leak kernel memory to achieve further exploitation.

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 the smbfs_mount function does not validate the length of the user-supplied mount data before reading it, causing an out-of-bounds read.

Impact

An attacker could leak kernel memory, which may help with further exploitation; the text does not claim a full compromise on its own.

What the attacker needed

Local access to run a mount syscall; no special privilege needed

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 code that runs with the highest privileges inside the operating system. Here, a routine that handles mounting an SMB network share reads more data than it was given, so bytes from the computer's protected memory can end up where the attacker can see them. Leaked memory can contain addresses or secrets that make a later attack easier.

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.