Safeguard
Application Security•

ASVS 5.0 V13.4.3: Do Not Expose Directory Listings

ASVS 5.0 V13.4.3 (Level 2): web servers must not list directory contents unless you meant them to. The config switches and a one line test.

Safeguard Security Team
2 min read

ASVS 5.0 V13.4.3 is a Level 2 requirement. Your web server must not return directory listings to clients unless you explicitly intend to publish a browsable folder.

Automatic indexes turn a missing index.html into a file browser.

Why it matters

A listing shows backups, exports, old uploads and file names that hint at internal tools. Attackers use them to find db.sql.gz or config.bak without guessing. The listing is rarely the bug on its own, but it removes the guesswork from the next step.

How to implement it

nginx (off by default, make it explicit):

autoindex off;

Apache:

Options -Indexes

Node static serving:

app.use(express.static("public", { index: "index.html", redirect: false }));
// serve-index is not installed, so no listing exists

For object storage fronted by a CDN, check that public bucket listing is off even when objects are public.

If you do want a public file index, such as a download mirror, configure it for that one path and say so in a comment.

How to test it

curl -s https://example.com/static/ | grep -i "index of"

No match is the pass. Try each folder you know exists: /uploads/, /assets/, /backup/, /images/. Expect 403 or 404, not a list.

Common mistakes

  • Disabling listings on the main host but not on the asset subdomain.
  • Forgetting the bucket policy for the storage backend.
  • Leaving a development static server in the production image.

Quick check

Does a 403 on the folder protect the files inside?

No. It only hides the list. Each file is still reachable by exact URL, so access control must be set per file.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.