Skip to main content

Directory listing

Description

The system displays the applications directories, allowing an attacker to know the content of the files stored on the server.

Impact

  • Obtain technical or sensitive information of the files stored in the applications directory.
  • Collect technical information on the application.

Recommendation

  • Disable the configurations of the server that allow to execute directory listing.
  • Establish index files that will be shown when the directories are loaded.

Threat

External attacker with access to the application.

Expected Remediation Time

⌚ 15 minutes.

Score

Default score using CVSS 3.1. It may change depending on the context of the vulnerability.

Base

  • Attack vector: N
  • Attack complexity: L
  • Privileges required: N
  • User interaction: N
  • Scope: U
  • Confidentiality: L
  • Integrity: N
  • Availability: N

Temporal

  • Exploit code madurity: X
  • Remediation level: X
  • Report confidence: X

Result

  • Vector string: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N/E:X/RL:X/RC:X
  • Score:
    • Base: 5.3
    • Temporal: 5.3
  • Severity:
    • Base: Medium
    • Temporal: Medium

Code Examples

Compliant code

The configuration settings deny directory listing for all unauthorized users

//server .htaccess file
Header set X-Custom "Custom Value"
RewriteCond %{HTTP_REFERER} unwanteddomain\.com [NC,OR]
RewriteCond %{REQUEST_METHOD} !^(HEAD|OPTIONS|POST|PUT)
RewriteRule .* - [F]
//Adding rule to deny directory listing
Options -Indexes

Non compliant code

There are some server configuration settings that allow directories to be listed

//server .htaccess file
Header set X-Custom "Custom Value"
RewriteCond %{HTTP_REFERER} unwanteddomain\.com [NC,OR]
RewriteCond %{REQUEST_METHOD} !^(HEAD|OPTIONS|POST|PUT)
RewriteRule .* - [F]

Requirements