DEV Community

SorrelThorncroft
SorrelThorncroft

Posted on

SMB access-based enumeration hides names, not permissions

SMB access-based enumeration hides names, not permissions

Access-based enumeration is a useful SMB feature. When it is enabled, users see only the files and folders they have permission to access. The result is a cleaner browse experience and less incidental disclosure of project names, customer directories, and file structure. It is not an access-control mechanism by itself.

Microsoft's documentation states that access-based enumeration is disabled by default for new SMB shares. The setting can be enabled per share, and the folder enumeration mode can be AccessBased or Unrestricted. In DFS namespaces, folder permissions are used to display or hide namespace folders, while the underlying share permissions still control access to folder targets. That separation is the part administrators miss.

A user who cannot see a folder may still be able to open it by using a known path or a previously saved shortcut. If the share and file-system ACLs allow access, hiding the name does not block the request. Hidden content is still recoverable through an application that remembers a path, a backup index, or a search result. The same is true for an SMB client that caches a directory listing.

Build the access review from effective permissions. Compare the share-level allow and deny entries with the NTFS file-system ACL on each target. Account for groups, inherited entries, central access policies, and explicit deny rules. Then test with a real user token from a domain-joined workstation. Use the UNC path for effective permission checks because share-level and file-system checks both apply.

Do not use enumeration as a substitute for removing stale data. An old folder that contains secrets should be archived, deleted, or moved to a restricted store. Hiding it only reduces accidental discovery. It also creates an ownership problem if nobody remembers the folder exists.

Review guest and anonymous access separately. A public share may be intentional for a distribution folder, but it should not expose parent directories or administrative tooling. Give the public share its own path, with a narrow ACL and no inheritance from a broader data volume. Test listing, direct file access, and direct folder access through the share name.

Logging should cover the actual access decisions. Enable file-server auditing for sensitive shares and retain the identity, source host, share, path, and result. If an application uses a service account to browse a share on behalf of users, review that application's granted rights. A broad service account can make every user look the same to SMB.

Access-based enumeration improves the interface. Permission reviews protect the data. Keep the second control in place even when the first one makes everything look tidy.

References

Top comments (0)