Config Files Directory Browsing Enabled
Description
Directory browsing allows attackers to view the contents and structure of web application directories when enabled in ASP.NET configurations. This can expose sensitive files, application structure, and other information that aids in attacking the application.
Detection Strategy
• Search web.config files for directory browsing configurations
• Check for <directoryBrowse> XML tags where enabled='true'
• Report vulnerability when directory browsing is explicitly enabled
Vulnerable code example
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!-- SECURITY RISK: Enabling directory browsing exposes file listing to unauthorized users -->
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>✅ Secure code example
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!-- Directory browsing disabled to prevent unauthorized file/folder enumeration -->
<directoryBrowse enabled="false" />
<!-- Define default documents to serve when directory is accessed -->
<defaultDocument>...Search for vulnerabilities in your apps for free with Fluid Attacks' automated security testing! Start your 21-day free trial and discover the benefits of the Continuous Hacking Essential plan. If you prefer the Advanced plan, which includes the expertise of Fluid Attacks' hacking team, fill out this contact form.