Skip to content
Path traversal Advisory Intermediate CVE-2021-30721

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.

Aleksandar Nikolic Follow

Originally disclosed on Cisco Talos

Medium 4.3 View original

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.

Aleksandar Nikolic, on Cisco Talos

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

  1. Authenticate to the SMB server with a user account that has access to a share.
  2. Send a QUERY_DIRECTORY request containing an absolute path starting with a slash.
  3. 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.

More by Aleksandar Nikolic

View all

147 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.