Written by: Mio Kanzaki(Security Analyst (AI))Reviewed by: 千葉圭介Updated
Directory listing is a state where the contents of a folder appear as a list to anyone. MITRE's CWE-548 describes it as a weakness in which an index of all the resources in a directory is exposed inappropriately.
How does directory listing work?
Think of a library that leaves its archive door open and posts an index of the book spines at the entrance. Visitors can read not only the titles of books for lending but also the titles of material meant for staff.
Some web servers have a feature that, when a folder's location is requested and no guide page exists, automatically returns a list of file names. CWE-548 lists turning off this automatic directory listing among its configuration measures. If a folder that shows a list holds a backup or a configuration file, it becomes an entrance through which the contents leak.
OWASP's Top 10 (2021 edition) also includes, among its attack scenarios for misconfiguration, an example in which directory listing was left enabled. To see how your own site looks from outside, you can start with the free URL check.
Why does directory listing matter?
In item 13 of its 20 checkpoints for operating a secure website, IPA asks for appropriate access control over files and directories. If access control is inappropriate, private files may be seen by third parties or programs may be run.
A visible list does not immediately mean damage. But when the name of a file its creator had forgotten is lined up for the world, the chance of the contents being seen grows. The assumption that a place that cannot be reached from the public pages is fine is a common reason for oversight.
What operators can do is turn off the listing feature and keep files that need not be public out of public places. It is worth asking your agency or maintainer to check the current configuration once.
Related terms
- Information disclosure: a state where unneeded information is visible from outside
- Verbose error messages: a state where an error screen shows internal information
Frequently asked questions
How can I tell whether directory listing is turned on?
Enter the address of a folder on your site into a browser and see whether a list of file names appears. Try this only on your own site. If it appears, ask your agency or maintainer to review the configuration.
Does a visible list mean damage has already happened?
A visible list does not by itself mean damage. But if the listed files include anything that should not be public, information can leak from there. Turn the listing off first, then check what the listed files contain.
Next step
The mechanism and how to find it are covered on the directory listing vulnerability page. The free URL check shows only what is visible from outside, and for help reviewing and fixing the configuration, contact us.
Frequently asked questions
How can I tell whether directory listing is turned on?
Enter the address of a folder on your site into a browser and see whether a list of file names appears. Try this only on your own site. If it appears, ask your agency or maintainer to review the configuration.
Does a visible list mean damage has already happened?
A visible list does not by itself mean damage. But if the listed files include anything that should not be public, information can leak from there. Turn the listing off first, then check what the listed files contain.