IIS Short Filename Disclosure
IIS responds differently to requests that match a file's short 8.3 name, letting an attacker work out the start of file and folder names in the web root.
| Severity | Low |
| CVSS 3.1 | 3.7 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N Open in the calculator |
| CVSS 4.0 | 6.3 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-204: Observable Response Discrepancy |
| MITRE ATT&CK | T1594 Search Victim-Owned Websites |
| Category | Information Disclosure |
Description
Windows NTFS volumes can give each file and folder with a long name an additional short name in the old 8.3 format, made up of the first characters of the name, a tilde and a number, and a three-character extension (for example BACKUP~1.ZIP). Microsoft IIS responds differently to requests that contain a tilde and wildcard characters depending on whether a matching short name exists, so an attacker can work out, one character at a time, the first six characters of the names of files and folders under the web root and the first three characters of their extensions. This works whether or not directory listing is enabled, and depends on short name creation having been enabled on the volume when the files were created: switching it off later does not remove short names that already exist.
The names reveal files that nothing links to and point an attacker to content worth guessing in full, such as backups, archives, old versions of pages, administrative scripts and configuration copies. The issue does not reveal the content of any file and the full names must still be guessed, so its value depends on what the web root contains: it is most useful to an attacker where sensitive files have been left in web-accessible directories.
The HTTP methods and response codes involved vary between IIS versions and configurations. The issue is reported by many web scanners, and is confirmed with tools such as the IIS Short Name Scanner, or by comparing the responses to crafted requests for a name that exists and one that does not.
Remediation
Remove the short names from the web content and stop new ones being created:
- Disable 8.3 name creation with
fsutil 8dot3name set: the value 1 on its own disables it for all volumes (it sets the registry valueNtfsDisable8dot3NameCreationunderHKLM\SYSTEM\CurrentControlSet\Control\FileSystem), while a volume followed by 1 disables it for that volume when the system-wide setting allows per-volume control.fsutil 8dot3name queryshows the current state. - Remove existing short names from the web content with
fsutil 8dot3name strip, running it first with/t, which only reports what would change, because some software relies on short names. Alternatively, recreate the content by copying it to a new folder once creation is disabled. - Keep backups, archives and other non-public files out of web-accessible directories, so that discovering a name gains nothing.
- As an interim measure, use IIS request filtering to reject URLs that contain a tilde, after checking that the application does not use tildes in legitimate addresses.
Confirm the fix by repeating the scan, which should no longer recover any names.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.