.DS_Store file
- PCI 3.2-6.5.1
- CWE 200
- CAPEC 152
- OWASP 2017-A6
- WASC 33
- CWE 425
- WASC 34
The .DS_Store file is a hidden macOS system file created in directories to store metadata such as icon positions, view settings, and folder attributes. When inadvertently uploaded to web-accessible directories, .DS_Store files can leak sensitive information about directory structure, filenames, and other system data. Attackers can use this information to map the application’s file system, locate backup files, configuration files, or other sensitive resources, facilitating further attacks such as file inclusion, information disclosure, or predictable resource access.
Common patterns leading to .DS_Store exposure:
- Uploading directories from macOS without removing
.DS_Storefiles. - Deploying websites or web applications directly from development machines with
.DS_Storefiles included. - Misconfigured web servers serving hidden files or ignoring default deny rules.
- Lack of scanning for hidden files during deployment.
Impacts:
- Information Disclosure: Reveals directory contents, file names, and potentially sensitive resources.
- Facilitates Enumeration: Attackers can discover hidden files, backup directories, or configuration files.
- Increases Attack Surface: Knowledge from
.DS_Storecan be used for targeted attacks. - Reconnaissance Aid: Provides attackers with insight into application structure and potential vulnerabilities.
Detection indicators:
- Requests to
.DS_Storereturn the file contents in the browser. - Security scans flag
.DS_Storefiles in web-accessible directories. - Automated tools detect metadata revealing directory structure or filenames.
Remediation
Mitigation strategies focus on preventing exposure and removing unnecessary files:
Remove
.DS_StoreFiles Before Deployment
Ensure that all hidden files from macOS development environments are deleted prior to deployment.Block Access via Web Server Configuration
Deny access to.DS_Storeand other hidden files using.htaccess,nginxrules, or server configuration.Scan Deployment Packages
Include checks for hidden or unnecessary system files as part of the deployment pipeline.Educate Developers
Train teams to be aware of.DS_Storefiles and their potential risks when deploying web applications.Automate Cleanup
Use scripts or deployment tools to automatically remove hidden macOS files.Monitor and Audit Web Directories
Regularly review publicly accessible directories to ensure no hidden system files are exposed.Security Testing
Include checks for.DS_Storeand similar hidden files during penetration testing and automated security scans.
References
Search Vulnerability
You may also see
- Readable .htaccess file
- apc.php page
- Webalizer script
- phpinfo page
- Apache perl-status Enabled
- Apache server-info Enabled
- Apache server-status Enabled
- JetBrains .idea project directory
- AWStats script
- elmah.axd Detected
- Core dump checker PHP script
- trace.axd Detected
- .DS_Store file
- Macromedia Dreamweaver database scripts
- Help file
- robots.txt Detected
- Sitemap Detected
- crossdomain.xml Detected
- Silverlight Client Access Policy
- Laravel log file
- Code Repository
- Configuration File
- Administration page
- Predictable Resource Location
- Code Repository
- Configuration File
- Administration page