CAPEC-127
Directory Indexing
An adversary crafts a request to a target that results in the target listing/indexing the content of a directory as output. One common method of triggering directory contents as output is to construct a request containing a path that terminates in a directory name rather than a file name since many applications are configured to provide a list of the directory's contents when such a request is received. An adversary can use this to explore the directory tree on a target as well as learn the names of files. This can often end up revealing test files, backup files, temporary files, hidden files, configuration files, user accounts, script contents, as well as naming conventions, all of which can be used by an attacker to mount additional attacks.
On this page
Ask an AI about this attack pattern
Show the prompt
Explain the attack pattern CAPEC-127: Directory Indexing: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/127.html and https://cve.bz/cve/capec/127?via=ask-ai-copy, which lists recent CVEs with the weaknesses it exploits. Cite the sources.Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this attack pattern's id and public links.
How the attack unfolds
Explore
The attacker looks for a way in.
[Directory Discovery] Use a method, either manual, scripted, or automated to discover the directories on the server by making requests for directories that may possibly exist. During this phase the adversary is less concerned with whether a directory can be accessed or indexed and more focused on simply discovering what directories do exist on the target.
3 techniques
- Send requests to the web server for common directory names
- If directories are discovered that are native to a server type further refine the directory search to include directories usually present on those types of servers.
- Search for uncommon or potentially user created directories that may be present.
Experiment
They probe what they found.
[Iteratively explore directory/file structures] The adversary attempts to access the discovered directories that allow access and may attempt to bypass server or application level ACLs by using manual or automated methods
5 techniques
- Use a scanner tool to dynamically add directories/files to include their scan based upon data obtained in initial probes.
- Use a browser to manually explore the website by issuing a request ending the URL in a slash '/'.
- Attempt to bypass ACLs on directories by using methods that known to work against some server types by appending data to the directory request. For instance, appending a Null byte to the end of the request which may cause an ACL to fail and allow access.
- Sequentially request a list of common base files to each directory discovered.
- Try multiple fuzzing techniques to list directory contents for directories that will not reveal their contents with a "/" request
Exploit
They carry out the attack.
[Read directories or files which are not intended for public viewing.] The adversary attempts to access the discovered directories that allow access and may attempt to bypass server or application level ACLs by using manual or automated methods
6 techniques
- Try multiple exploit techniques to list directory contents for directories that will not reveal their contents with a "/" request
- Try other known exploits to elevate privileges sufficient to bypass protected directories.
- List the files in the directory by issuing a request with the URL ending in a "/" slash.
- Access the files via direct URL and capture contents.
- Attempt to bypass ACLs on directories by using methods that are known to work against some server types by appending data to the directory request. For instance, appending a Null byte to the end of the request which may cause an ACL to fail and allow access.
- Sequentially request a list of common base files to each directory discovered.
Prerequisites
The target must be misconfigured to return a list of a directory's content when it receives a request that ends in a directory name rather than a file name.
The adversary must be able to control the path that is requested of the target.
The administrator must have failed to properly configure an ACL or has associated an overly permissive ACL with a particular directory.
The server version or patch level must not inherently prevent known directory listing attacks from working.
Skills required
- Low skill
To issue the request to URL without given a specific file name
- High skill
To bypass the access control of the directory of listings
Resources required
Ability to send HTTP requests to a web application.
Consequences
| Impact | Affects | Note |
|---|---|---|
| Read Data | Confidentiality | Information Leakage |
Mitigations
1. Using blank index.html: putting blank index.html simply prevent directory listings from displaying to site visitors.
2. Preventing with .htaccess in Apache web server: In .htaccess, write "Options-indexes".
3. Suppressing error messages: using error 403 "Forbidden" message exactly like error 404 "Not Found" message.
Weaknesses it exploits
- CWE-276 Incorrect Default Permissions
- CWE-285 Improper Authorization
- CWE-288 Authentication Bypass Using an Alternate Path or Channel
- CWE-424 Improper Protection of Alternate Path
- CWE-425 Direct Request
- CWE-693 Protection Mechanism Failure
- CWE-732 Incorrect Permission Assignment for Critical Resource
Recent CVEs with these weaknesses
- 5.3CVE-2026-140130
A flaw has been found in jobic10 student-management-using-django up to 066dcaeffc52fe52e9279d93e2a00c15909544ae. This affects the function get_students/save_attendance/get_student_attendance/update_attendance of the file main_app/staff_vie…
- 6.5CVE-2026-115423
A flaw was found in FreeIPA. An access control instruction (ACI) intended to allow presence-checking on password and Kerberos principal-key attributes grants unrestricted SEARCH rights on userPassword and krbPrincipalKey to all authenticat…
- 4.8CVE-2026-139892
A flaw has been found in MervinPraison PraisonAI up to 4.7.24. This issue affects the function _load_rules of the file praisonaiagents/permissions/manager.py of the component Permission Manager. This manipulation causes improper authorizat…
- 1.9CVE-2026-139891
A security vulnerability has been detected in KunAgent Kun up to 0.4.5. This affects the function launchResumeTurn of the file kun/src/loop/interrupted-turn-coordinator.ts of the component Turn Resume. The manipulation leads to incorrect a…
- 5.5CVE-2026-139890
A weakness has been identified in KunAgent Kun up to 0.4.5. Affected by this issue is the function buildWorkflowHookRun of the file kun/src/hooks/hook-config.ts of the component Workflow Hooks. Executing a manipulation can lead to improper…
- 1.9CVE-2026-139889
A vulnerability was identified in Moonshot AI Kimi Code up to 2.5.2. Affected is the function AgentToolPolicyService of the file packages/agent-core-v2/src/agent/toolPolicy/toolPolicyService.ts of the component Tool Policy. Such manipulati…
- 4.8CVE-2026-139888
A vulnerability was determined in Twigpine Zero up to 0.14.0. This impacts the function LoadConfig of the file internal/hooks/hooks.go. This manipulation causes improper authorization. It is possible to launch the attack on the local host.
- 4.8CVE-2026-139886
A vulnerability has been found in ApodexAI FrontierAgent up to 0.1.0. The impacted element is the function PermissionStore.load of the file apodex/permissions.py. The manipulation leads to improper authorization. An attack has to be approa…
The newest records naming one of them. Each weakness's page lists them all.
Related attack patterns
- Part of
- CAPEC-54 Query System for Information
Examples
The adversary uses directory listing to view sensitive files in the application. This is an example of access…
The adversary uses directory listing to view sensitive files in the application. This is an example of accessing the backup file. The attack issues a request for http://www.example.com/admin/ and receives the following dynamic directory indexing content in the response: Index of /admin Name Last Modified Size Description backup/ 31-May-2007 08:18 - Apache/ 2.0.55 Server at www.example.com Port 80
The target application does not have direct hyperlink to the "backup" directory in the normal html webpage, however the attacker has learned of this directory due to indexing the content. The client then requests the backup directory URL and receives output which has a "db_dump.php" file in it. This sensitive data should not be disclosed publicly.
MITRE's words, unchanged: CAPEC-127 at MITRE. CAPEC is Copyright © 2007–2026, The MITRE Corporation, used under the CAPEC terms of use: “The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use Common Attack Pattern Enumeration and Classification (CAPEC™) for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE’s copyright designation and this license in any such copy.” CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. Credits. All attack patterns.