Apple macOS SMB server directory query arbitrary file access
The macOS SMB server's QUERY_DIRECTORY handling allows an authenticated user to supply an absolute path starting with a slash, bypassing share restrictions and leaking metadata of arbitrary files. An attacker could also enumerate existing files and directories, including user home directories, to discover usernames.
Originally disclosed on Cisco Talos
An arbitrary file access vulnerability exists in the SMB Server Apple macOS 11.2. A specially crafted SMB request can leak metadata of arbitrary files.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the QUERY_DIRECTORY handler failed to validate that the search string was relative to the share, allowing absolute paths to be processed directly.
Impact
An authenticated user could read metadata (such as timestamps and sizes) of any file the underlying user can access, and could enumerate existing files and directories to discover usernames; the vulnerability does not allow reading file contents.
What the attacker needed
Authenticated SMB user; access to an SMB share
The fix
The vendor patched the vulnerability.
How it was found
- Authenticate to the SMB server with a user account that has access to a share.
- Send a QUERY_DIRECTORY request containing an absolute path starting with a slash.
- Receive metadata about the requested file or directory in the response.
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 report has not been written yet. The Original tab links to the source.
SMB is a protocol for sharing files over a network. When you ask the server to list files in a folder, you are supposed to be limited to the shared folder. Here, the server did not check that the requested path stayed inside the share, so a user could ask about files anywhere on the system and learn details like file size and timestamps.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.