(CVE-2021-30844) macOS smbfs Out-of-Bounds Read
The macOS smbfs kernel driver mishandles user-supplied input in the SMBIOC_T2RQ ioctl handler, copying an attacker-controlled length of data from a user-mode pointer. An attacker could use this to leak kernel memory and 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 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 handler trusts an attacker-controlled length when copying the user-supplied name, without validating it against the actual buffer.
What the attacker needed
Local access to the macOS system
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 is privileged code that runs at the core of the operating system. Here a driver that handles file-sharing connections copies data from a program using a size the program itself chooses, so it can read past the intended buffer and expose memory the program should not see.
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.