Exposure of Information Through Directory Listing

Draft Variant
Structure: Simple
Description

This vulnerability occurs when a web server is misconfigured to display a full list of files within a directory instead of serving a default web page, unintentionally exposing sensitive resources to anyone who visits the URL.

This vulnerability occurs when a web server is misconfigured to display a full list of files within a directory instead of serving a default web page, unintentionally exposing sensitive resources to anyone who visits the URL.
Extended Description

Directory listings happen when a web server (like Apache, Nginx, or IIS) can't find a default index file (e.g., index.html) and its configuration allows it to show the folder's contents. This acts as a roadmap for attackers, revealing backup files, configuration scripts, temporary uploads, or administrative interfaces that were never meant to be public. A simple manual check or a DAST scan can easily uncover this issue. Prevention involves configuring your server to disable directory listings and always ensuring a default index page exists. For developers, this means checking server configuration files for directives like 'Options -Indexes' in Apache or 'autoindex off' in Nginx. Managing this at scale across hundreds of services is difficult; an ASPM like Plexicus can help you continuously track and automatically flag these misconfigurations across your entire application portfolio.

Common Consequences 1
Scope: Confidentiality

Impact: Read Files or Directories

Exposing the contents of a directory can lead to an attacker gaining access to source code or providing useful information for the attacker to devise exploits, such as creation times of files or any information that may be encoded in file names. The directory listing may also compromise private or confidential data.

Detection Methods 1
Automated Static AnalysisHigh
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Potential Mitigations 1
Phase: Architecture and DesignSystem Configuration
Recommendations include restricting access to important directories or files by adopting a need to know requirement for both the document and server root, and turning off features such as Automatic Directory Listings that could expose private files and provide information that could be utilized by an attacker when formulating or conducting an attack.
References 2
Directory Indexing
Web Application Security Consortium
20-05-2009
ID: REF-1458
Directory indexing attacks
IBM
08-03-2021
ID: REF-1459
Modes of Introduction
Implementation
Operation
Taxonomy Mapping
  • OWASP Top Ten 2004
  • WASC