Public folders should never allow automatic directory listing. If directory browsing is enabled, visitors can see every file name and structure inside those folders. Even if the files look harmless, attackers often use this information to plan attacks, find hidden scripts, or download sensitive files.
Disabling directory listing makes the system less transparent to attackers. It reduces information leaks and forces an attacker to work harder instead of simply browsing your files like a public index.
# Try to open a folder URL without index.php or index.html
https://yourstore.com/media/
https://yourstore.com/pub/static/
# If you see a file list, directory listing is enabled (bad).
# If you see 403 Forbidden or 404 Not Found, it is disabled (good).
Options -Indexes is set.autoindex off; inside server or location blocks.pub/, media/, static/).# Browser shows full file list
Index of /media/
file1.jpg
backup.zip
# Browser shows forbidden message
403 Forbidden
# or custom error page