Glossary

Directory listing

Directory listing is the behaviour where a web server, asked for a path with no index file, generates a page listing the files in that directory. It is occasionally deliberate — a downloads folder, a package repository — and usually accidental, left on by a default configuration. Where it is accidental it converts files that were merely unlinked into files that are enumerable, which is a meaningful difference.

What it exposes

Every filename in the directory, including ones nothing links to and nobody expected to be found.

Backup files left beside their originals — a configuration file with a `.bak` or `.old` suffix, an editor's save file, an archive created before a change.

Structure: a listing of an upload directory reveals how filenames are generated, which frequently shows they are guessable.

Timestamps and sizes, which say when things changed and roughly what they are.

The underlying issue in most cases is not the listing but the files: anything that should not be public should not be in a public directory at all.

Where it turns up

Upload and media directories, which frequently have no index file because nothing ever needed one.

Asset directories on servers where the framework serves the application and the web server serves everything else with default settings.

Subdirectories of a content management system installation, particularly those added by plugins.

Staging and secondary environments, which are set up quickly and reviewed rarely.

Object storage buckets mapped to a hostname, where the listing behaviour is a property of the bucket's permissions rather than of any web server configuration.

How to switch it off

Apache: `Options -Indexes`, in the server configuration or in a directory file.

nginx: `autoindex off`, which is the default and is usually enabled deliberately when present.

IIS: directory browsing is disabled by default and is enabled through the feature setting.

An `index.html` file in the directory suppresses the listing regardless of configuration, which is a workaround rather than a fix — it hides the enumeration and leaves the files reachable by name.

How to check for it

Request a directory path with a trailing slash and no filename. A generated listing page is the finding; a 403 or 404 is the expected answer.

Test the directories most likely to lack an index file: uploads, media, assets, backups, and anything added by a plugin.

Check secondary hostnames as well, since staging environments are the usual place it survives.

Where a listing is found, review what is in the directory before anything else. The files are the problem the listing revealed.

Search for the obvious backup suffixes by name even where no listing exists — an unlinked file is still reachable, and enumeration is only the convenient way to find it.

Frequently asked questions

Is directory listing a vulnerability?
It is an information disclosure rather than a vulnerability on its own. What it costs depends entirely on what is in the directory.
Does adding an index.html fix it?
It suppresses the listing. The files remain reachable by name, so disabling the feature and removing what should not be public is the real fix.
Are there legitimate uses?
Yes — download archives and package repositories rely on it deliberately. The problem is the accidental case.

Sources

Related

VeriFixScan crawls a site and applies its checks to every page it reaches, keeping the evidence behind each finding. Scanning one website is free.

Scan a website